jiang1002 commited on
Commit
43b171b
·
verified ·
1 Parent(s): 2e301f3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -1
Dockerfile CHANGED
@@ -2,11 +2,16 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
 
 
 
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
  COPY . .
9
 
 
10
  EXPOSE 7860
11
 
12
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # 先安装 gradio 和 requests 确保基础环境
6
+ RUN pip install --no-cache-dir gradio requests
7
+
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
  COPY . .
12
 
13
+ # Hugging Face Spaces 必须暴露 7860
14
  EXPOSE 7860
15
 
16
+ # 修改这里:直接运行 python app.py
17
+ CMD ["python", "app.py"]