File size: 386 Bytes
bc7ad40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
FROM python:3.9-slim

WORKDIR /app

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

# 复制应用代码
COPY app.py config.py ./

# 暴露 Hugging Face Space 默认端口
EXPOSE 7860

# 使用 gunicorn 启动 Flask 应用(更稳定)
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "90", "--workers", "2", "app:app"]