FROM python:3.9-slim WORKDIR /app # 安装依赖 COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # 复制应用代码 COPY . . # 设置端口 ENV PORT=7860 EXPOSE 7860 # 启动命令 CMD ["python", "app.py"]