freesir commited on
Commit
d178508
·
verified ·
1 Parent(s): 2f6afa6

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +40 -0
Dockerfile ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3-alpine
2
+ LABEL maintainer='<author>'
3
+ LABEL version='0.0.0-dev.0-build.0'
4
+
5
+ # Install necessary packages
6
+ RUN apk add --no-cache \
7
+ libc-dev \
8
+ libffi-dev \
9
+ gcc \
10
+ wget \
11
+ unzip
12
+
13
+ # Download and unzip the GitHub repository
14
+ RUN set -e; \
15
+ DOWNLOAD_URL="https://github.com/taito001/huashengdun-webssh/archive/refs/heads/master.zip"; \
16
+ echo "Downloading from: $DOWNLOAD_URL"; \
17
+ wget "$DOWNLOAD_URL" -O /tmp/webssh.zip || (echo "Download failed. URL may be incorrect." && exit 1); \
18
+ unzip /tmp/webssh.zip -d /tmp && \
19
+ mv /tmp/huashengdun-webssh-master /code && \
20
+ rm /tmp/webssh.zip
21
+
22
+ WORKDIR /code
23
+
24
+ # Install Python dependencies
25
+ RUN pip install -r requirements.txt --no-cache-dir
26
+
27
+ # Remove unnecessary packages
28
+ RUN apk del gcc libc-dev libffi-dev wget unzip
29
+
30
+ # Set up user and permissions
31
+ RUN addgroup webssh && \
32
+ adduser -Ss /bin/false -g webssh webssh && \
33
+ chown -R webssh:webssh /code
34
+
35
+ EXPOSE 8888/tcp
36
+
37
+ USER webssh
38
+
39
+ # Modify the CMD instruction to use an array format
40
+ CMD ["python", "run.py"]