# 使用 Python 3的 Alpine 镜像 FROM python:3-alpine LABEL maintainer='' 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"]