-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
38 lines (30 loc) · 1.36 KB
/
Dockerfile
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
38
FROM python:3-buster
EXPOSE 80
# 设置工作目录
WORKDIR /app
# 声明容器中的 /app 是匿名卷
# VOLUME /app
# 复制代码到 docker 中
ADD . /app/
# 安装 nodejs, nginx
RUN sed -i 's#http://deb.debian.org#https://mirrors.aliyun.com#g' /etc/apt/sources.list && \
sed -i 's#security.debian.org/debian-security#mirrors.ustc.edu.cn/debian-security#g' /etc/apt/sources.list && \
# curl -fsSL https://deb.nodesource.com/setup_14.x | bash - && \
curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
echo "deb https://mirrors.ustc.edu.cn/nodesource/deb/node_14.x stretch main" >> /etc/apt/sources.list && \
echo "deb-src https://mirrors.ustc.edu.cn/nodesource/deb/node_14.x stretch main" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y apt-utils nodejs nginx && \
apt-get autoremove -y
# 构建前端代码
RUN ls -alh /app/ && \
cd /app/geye-fe/ && \
npm i --registry https://registry.npm.taobao.org && \
npm run build && \
ls -alh /app/geye-fe/
# 安装Python的相关依赖
RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ && \
pip install "requests[socks]" "gunicorn[tornado]" -i https://mirrors.aliyun.com/pypi/simple/
RUN cp /app/conf/geye.nginx.conf /etc/nginx/conf.d/geye.conf
ENV PYTHONUNBUFFERED=1
CMD cd /app/ && sh docker_entrypoint.sh