FROM python:3.10-slim # 安装 FFmpeg、系统证书(用于访问 HTTPS URL) RUN apt-get update && apt-get install -y \ ffmpeg \ ca-certificates \ libsm6 \ libxext6 \ && rm -rf /var/lib/apt/lists/* # 设置工作目录 WORKDIR /app # 复制依赖文件并安装 COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # 复制项目代码 COPY . . # 暴露 Hugging Face 默认端口 EXPOSE 7860 # 使用 uvicorn 启动 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]