Update Dockerfile
Browse files- Dockerfile +8 -5
Dockerfile
CHANGED
|
@@ -4,14 +4,17 @@ FROM python:3.9-slim-buster
|
|
| 4 |
# 设置工作目录为 /app
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
COPY . /app
|
| 9 |
|
| 10 |
# 安装 requirements.txt 中指定的任何所需软件包
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
|
| 16 |
-
#
|
|
|
|
|
|
|
|
|
|
| 17 |
CMD ["python", "app.py"]
|
|
|
|
| 4 |
# 设置工作目录为 /app
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# 将当前目录下的 requirements.txt 复制到容器的 /app/requirements.txt 中
|
| 8 |
+
COPY requirements.txt /app/
|
| 9 |
|
| 10 |
# 安装 requirements.txt 中指定的任何所需软件包
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
+
# 将当前目录下的其余文件复制到容器的 /app 中
|
| 14 |
+
COPY . /app/
|
| 15 |
|
| 16 |
+
# 使端口 5000 可供此容器外的世界使用
|
| 17 |
+
EXPOSE 5000
|
| 18 |
+
|
| 19 |
+
# 在容器启动时运行 app.py
|
| 20 |
CMD ["python", "app.py"]
|