taito0 commited on
Commit
601db53
·
verified ·
1 Parent(s): 82b0118

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -10
Dockerfile CHANGED
@@ -1,18 +1,39 @@
1
  FROM python:3-alpine
2
-
3
  LABEL maintainer='<author>'
4
  LABEL version='0.0.0-dev.0-build.0'
5
 
6
- ADD . /code
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  WORKDIR /code
8
- RUN \
9
- apk add --no-cache libc-dev libffi-dev gcc && \
10
- pip install -r requirements.txt --no-cache-dir && \
11
- apk del gcc libc-dev libffi-dev && \
12
- addgroup webssh && \
13
- adduser -Ss /bin/false -g webssh webssh && \
14
- chown -R webssh:webssh /code
 
 
 
 
15
 
16
  EXPOSE 8888/tcp
 
17
  USER webssh
18
- CMD ["python", "run.py"]
 
 
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
+ CMD ["python", "run.py", "--xsrf=False --xheaders=False --origin='*' --debug --delay=6"]