cwadayi commited on
Commit
536891c
·
verified ·
1 Parent(s): 7f3ee3b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -3
Dockerfile CHANGED
@@ -8,9 +8,10 @@ WORKDIR /code
8
  COPY ./requirements.txt /code/requirements.txt
9
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
 
11
- # 複製你的應用程式程式碼
12
- COPY ./app.py /code/app.py
 
13
 
14
  # 設定啟動指令:使用 gunicorn 啟動 app.py 中的 app 物件
15
  # 綁定到 0.0.0.0:7860,這是 HF Spaces 預期的端口
16
- 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
+ # 這會確保 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"]