FROM python:3.9-slim # 设置工作目录 WORKDIR /app # 复制requirements文件 COPY requirements.txt . # 安装Python依赖 RUN pip install --no-cache-dir -r requirements.txt # 复制应用文件 COPY . . # 暴露7860端口(Hugging Face Spaces要求) EXPOSE 7860 # 启动应用 CMD ["python", "app.py"]