| # 使用 Hugging Face 官方 CPU 镜像 | |
| FROM huggingface/space-python3.10-cpu | |
| # 安装系统依赖 | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| ffmpeg \ # 视频处理核心工具 | |
| git # 用于拉取子模块 | |
| && rm -rf /var/lib/apt/lists/* | |
| # 配置子模块(强制 HTTPS) | |
| RUN git config --global url."https://github.com".insteadOf "git@github.com:" | |
| # 复制代码并初始化子模块 | |
| COPY . /app | |
| WORKDIR /app | |
| RUN git submodule init && \ | |
| git submodule update --recursive # 递归拉取子模块 | |
| # 安装 Python 依赖 | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 启动命令 | |
| CMD ["python", "app.py"] |