FROM python:3.11-slim WORKDIR /app # 安装依赖(使用阿里云镜像) COPY backend/requirements.txt . RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -r requirements.txt # 复制代码 COPY backend/app ./app # 暴露端口 EXPOSE 8000 # 启动命令 CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]