Dockerfile 584 B

12345678910111213141516171819202122
  1. # 使用 Python 3.8.0 作为基础镜像
  2. FROM python:3.8
  3. # 设置工作目录
  4. WORKDIR /app
  5. # 复制当前目录下的所有文件到工作目录
  6. COPY . /app
  7. RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/
  8. # 安装依赖
  9. RUN pip install --no-cache-dir -r requirements.txt
  10. RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list && \
  11. sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
  12. RUN apt-get update && apt-get install -y libgl1
  13. # 暴露端口
  14. EXPOSE 2002
  15. # 运行应用程序
  16. CMD ["python", "main.py"]