加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
dockerfile 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
李瑞阳 提交于 2020-12-28 12:59 . 项目初步完成!
# nginx-gunicorn-flask with python3
FROM python
LABEL author="lry"
LABEL purpose = ''
RUN apt update
RUN apt install -y nginx supervisor
RUN pip3 install gunicorn
RUN pip3 install setuptools
ENV PYTHONIOENCODING=utf-8
# Build folder
RUN mkdir -p /deploy/app
WORKDIR /deploy/app
#only copy requirements.txt. othors will be mounted by -v
COPY ./requirements.txt /deploy/app/requirements.txt
RUN pip3 install -r /deploy/app/requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
# Setup nginx
RUN rm /etc/nginx/sites-enabled/default
COPY ./deploy/nginx_flask.conf /etc/nginx/sites-available/
RUN ln -s /etc/nginx/sites-available/nginx_flask.conf /etc/nginx/sites-enabled/nginx_flask.conf
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
# Setup supervisord
RUN mkdir -p /var/log/supervisor
COPY ./deploy/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY ./deploy/gunicorn.conf /etc/supervisor/conf.d/gunicorn.conf
# run sh. Start processes in docker-compose.yml
#CMD ["/usr/bin/supervisord"]
CMD ["/bin/bash"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化