Spaces:
Sleeping
Sleeping
chen commited on
Update Dockerfile
Browse files7 unmodified lines89101112131415167 unmodified linesCOPY ./requirements.txt /code/requirements.txtRUN pip install --no-cache-dir --upgrade -r /code/requirements.txt# 複製你的應用程式程式碼COPY ./app.py /code/app.py# 設定啟動指令:使用 gunicorn 啟動 app.py 中的 app 物件# 綁定到 0.0.0.0:7860,這是 HF Spaces 預期的端口CMD ["gunicorn", "--workers", "1", "--bind", "0.0.0.0:7860", "app:app"]7 unmodified lines8910111213141516177 unmodified linesCOPY ./requirements.txt /code/requirements.txtRUN pip install --no-cache-dir --upgrade -r /code/requirements.txt# [修正] 複製所有專案檔案到容器的 /code 目錄中# 這會確保 app.py 可以成功 import 其他 .py 檔案 (例如 config.py)COPY . /code/# 設定啟動指令:使用 gunicorn 啟動 app.py 中的 app 物件# 綁定到 0.0.0.0:7860,這是 HF Spaces 預期的端口CMD ["gunicorn", "--workers", "1", "--bind", "0.0.0.0:7860", "app:app"]
Dockerfile+4-3