Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- 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 |
-
|
|
|
|
| 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"]
|