| 1234567891011121314151617181920212223242526 |
- FROM python:3.6
- # 安装 git
- RUN apt-get update && apt-get install -y git
- # 设置用户名和密码作为构建参数
- ARG USERNAME=yf_yzl
- ARG PASSWORD=1qaz!QAZ
- # 对密码进行 URL 编码
- RUN export PASSWORD_ENCODED=$(printf %s "${PASSWORD}" | jq -s -R -r @uri)
- # 克隆 Git 仓库,使用 URL 编码的密码
- RUN git clone https://${USERNAME}:${PASSWORD_ENCODED}@114.115.147.140:63000/yf_yzl/QAWeb.git /code
- # 安装依赖
- RUN pip install -r /code/requirements.txt
- # 配置 uWSGI
- ENV UWSGI_WSGI_FILE=project.wsgi
- ENV UWSGI_HTTP=:8000
- ENV UWSGI_MASTER=1
- ENV UWSGI_WORKERS=2
- ENV UWSGI_THREADS=4
- CMD ["uwsgi", "--http", "$UWSGI_HTTP", "--http-timeout", "86400", "--master", "--wsgi-file", "$UWSGI_WSGI_FILE", "--processes", "1", "--threads", "$UWSGI_THREADS", "--workers", "$UWSGI_WORKERS"]
|