# 使用官方的Python 3.10基础镜像 FROM python:3.10 # 设置工作目录 WORKDIR /app # 复制当前目录下的所有文件到工作目录 COPY . /app # 配置pip使用清华镜像源 RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple # 配置python环境 RUN pip install --no-cache-dir -r requirements.txt # 运行一个简单的Python命令以确保环境正确配置 CMD ["python", "--version"]