代码拉取完成,页面将自动刷新
# Base images 基础镜像
FROM wupeiqi/centos76py39:1.0
#ENV LANG C.UTF-8
#ENV LC_ALL C.UTF-8
#MAINTAINER 维护者信息
MAINTAINER 690453996@qq.com
RUN pip3.9 config set global.index-url https://mirrors.aliyun.com/pypi/simple
# git
RUN yum install git -y
RUN git config --global user.name "weberChen"
RUN git config --global user.email "60453996@qq.com"
# git拉代码
WORKDIR /data/
# 后端代码
RUN git clone https://gitee.com/weberchen/engineer_project_serve.git
# 虚拟环境
WORKDIR /data/engineer_project_serve/
RUN pip3.9 install virtualenv
RUN virtualenv /envs/engineer_project_serve --python=python3.9
RUN /envs/engineer_project_serve/bin/pip3.9 install -r requirements.txt
# 收集静态资源 /data/allstatic/
WORKDIR /data/engineer_project_serve/
RUN /envs/engineer_project_serve/bin/python manage.py collectstatic
# 安装uwsgi
RUN /envs/engineer_project_serve/bin/pip3.9 install uwsgi
# 安装nginx
WORKDIR /data/engineer_project_serve/
RUN rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
RUN yum install nginx -y
# 易错点
RUN cp blog.conf /etc/nginx/myblog.conf
# 运行项目
WORKDIR /data/engineer_project_serve
# CMD ["/envs/blog/bin/uwsgi","--ini","uwsgi.ini"]
# CMD ["nginx","-c","/etc/nginx/myblog.conf","-g","daemon off;"]
CMD ["/bin/sh","run.sh"]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。