File size: 886 Bytes
2f4af38 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # 使用 Python 3的 Alpine 镜像
FROM python:3-alpine
LABEL maintainer='<author>'
LABEL version='0.0.0-dev.0-build.0'
# 安装 git 和其他必要的依赖
RUN apk add --no-cache \
git \
libc-dev \
libffi-dev \
gcc \
wget \
unzip
# 设置工作目录
WORKDIR /code
# 从 GitHub 拉取代码
RUN git clone https://github.com/cmliu/webssh.git .
# 安装依赖
RUN \
pip install -r requirements.txt --no-cache-dir && \
apk del gcc libc-dev libffi-dev wget unzip && \
addgroup webssh && \
adduser -Ss /bin/false -g webssh webssh && \
chown -R webssh:webssh /code
# 暴露端口
EXPOSE 8888/tcp
USER webssh
# 启动应用
CMD ["python", "run.py", "--delay=10", "--encoding=utf-8", "--fbidhttp=False", "--maxconn=20", "--origin=*", "--policy=warning", "--redirect=False", "--timeout=10", "--debug", "--xsrf=False", "--xheaders", "--wpintvl=1"] |