-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
27 lines (22 loc) · 650 Bytes
/
dockerfile
File metadata and controls
27 lines (22 loc) · 650 Bytes
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
# 使用 Python 3.8 作为基础镜像
FROM python:3.8
# 设置工作目录为 /app
WORKDIR /app
# 将当前目录下的所有文件(除了.dockerignore中指定的文件)复制到 /app
COPY src/* /app
RUN mkdir /app/entity
COPY src/entity/* /app/entity
RUN mkdir /app/static
RUN mkdir /app/static/js
COPY src/static/js/* /app/static/js
RUN mkdir /app/templates
COPY src/templates/* /app/templates
RUN mkdir /app/templates/admin
COPY src/templates/admin/* /app/templates/admin
# 安装依赖
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# 暴露端口
EXPOSE 8080
# 执行应用
CMD ["python", "app.py"]