Dockerfile 413 B

123456789101112131415161718
  1. # 使用官方 Python 基础镜像
  2. FROM python:3.10
  3. # 设置工作目录
  4. WORKDIR /docker
  5. # 将当前目录下的所有文件复制到镜像中
  6. COPY . .
  7. # 安装 Python 依赖
  8. RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
  9. # 暴露应用程序端口(例如 Flask 的默认端口)
  10. EXPOSE 4000
  11. # 指定容器启动时运行的命令
  12. CMD ["python", "run.py"]