ladyzoe's picture
create Dockerfile
b00c94a verified
raw
history blame
560 Bytes
# Dockerfile (這是你的 Hugging Face Space 將使用的 Docker 配置)
# 使用 Python 3.9 的輕量級基礎映像
FROM python:3.9-slim-buster
# 設定工作目錄為 /app
WORKDIR /app
# 複製 requirements.txt 並安裝所有 Python 依賴
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 複製所有應用程式檔案到容器中 (包括 app.py 和 best.pt)
COPY . .
# 暴露應用程式將運行的埠
EXPOSE 7860
# 定義容器啟動時執行的命令
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]