# 使用官方 Python 3.11 映像 FROM python:3.11-slim # 設置工作目錄 WORKDIR /app # 安裝系統依賴 RUN apt-get update && apt-get install -y \ ffmpeg \ git \ && rm -rf /var/lib/apt/lists/* # 複製 requirements.txt COPY requirements.txt . # 安裝 Python 依賴 RUN pip install --no-cache-dir -r requirements.txt # 複製專案文件 COPY app.py . COPY templates/ ./templates/ COPY start.sh . # 創建 uploads 目錄 RUN mkdir -p uploads # Hugging Face Spaces 使用端口 7860 ENV PORT=7860 EXPOSE 7860 # 啟動應用 CMD ["python", "app.py"]