jscmp4 commited on
Commit
1abeda3
·
verified ·
1 Parent(s): 0dcacf5

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -0
Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 使用官方 Python 基础镜像
2
+ FROM python:3.9
3
+
4
+ # 设置工作目录
5
+ WORKDIR /code
6
+
7
+ # 复制依赖文件并安装
8
+ COPY ./requirements.txt /code/requirements.txt
9
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
+
11
+ # 复制当前目录下的所有文件到工作目录
12
+ COPY . .
13
+
14
+ # 设置环境变量,确保 Flask 在 Docker 里能正常显示 log
15
+ ENV PYTHONUNBUFFERED=1
16
+
17
+ # 启动命令:运行 app.py
18
+ CMD ["python", "app.py"]