cwadayi commited on
Commit
d2ecf8f
·
verified ·
1 Parent(s): 1c90e24

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -5
Dockerfile CHANGED
@@ -8,10 +8,9 @@ WORKDIR /code
8
  COPY ./requirements.txt /code/requirements.txt
9
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
 
11
- # [修正] 複製所有專案檔案到容器的 /code 目錄中
12
- # 這會確保 app.py 可以成功 import 其他 .py 檔案 (例如 config.py)
13
  COPY . /code/
14
 
15
- # 設定啟動指令:使用 gunicorn 啟動 app.py 中的 app 物件
16
- # 綁定到 0.0.0.0:7860,這是 HF Spaces 預期的端口
17
- CMD ["gunicorn", "--workers", "1", "--bind", "0.0.0.0:7860", "app:app"]
 
8
  COPY ./requirements.txt /code/requirements.txt
9
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
 
11
+ # 複製所有專案檔案到容器的 /code 目錄中
 
12
  COPY . /code/
13
 
14
+ # [修正] 設定啟動指令,並增加 --timeout 參數
15
+ # 將逾時時間延長至 120 秒,以允許 AI 模型在 CPU 上有足夠的時間載入
16
+ CMD ["gunicorn", "--workers", "1", "--bind", "0.0.0.0:7860", "--timeout", "120", "app:app"]