FROM python:3.11-slim WORKDIR /app # 安裝系統依賴 RUN apt-get update && apt-get install -y \ ffmpeg \ && rm -rf /var/lib/apt/lists/* # 複製應用程式檔案 COPY requirements.txt . COPY *.py . COPY *.json ./ # 安裝 Python 依賴 RUN pip install --no-cache-dir -r requirements.txt # 設定環境變數 ENV PORT=8080 ENV IS_ENV_LOCAL=false # 暴露連接埠 EXPOSE 8080 # 啟動應用程式 CMD exec python app.py