# 使用官方 Python 镜像 FROM python:3.9-slim # 设置工作目录 WORKDIR /app # 安装依赖 COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # 复制代码 COPY . . # 启动命令 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]