File size: 385 Bytes
9419963
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 使用官方 Python 镜像作为基础镜像
FROM python:3.9-slim

# 设置工作目录
WORKDIR /app

# 复制 requirements.txt 并安装依赖
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# 复制当前目录的内容到工作目录
COPY . .

# 暴露应用程序端口
EXPOSE 7860

# 运行 Flask 应用程序
CMD ["python", "app.py"]