Dockerfile 912 B

12345678910111213141516171819202122232425262728
  1. # 使用Python作为基础镜像
  2. FROM python:3.11
  3. # 设置工作目录
  4. WORKDIR /app
  5. # 复制应用代码到容器中
  6. COPY . /app
  7. # 替换源
  8. # RUN sed -i s/deb.debian.org/mirrors.aliyun.com/g /etc/apt/sources.list
  9. #ADD sources.list /etc/apt/
  10. # 更新
  11. # RUN apt-get clean
  12. # RUN apt-get update
  13. # 安装ADB
  14. # RUN apt-get install -y android-tools-adb telnet net-tools
  15. # 调整时区
  16. ENV TZ=Asia/Shanghai
  17. # 安装依赖项
  18. RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
  19. # RUN pip install --no-cache-dir -r requirements.txt -i https://repo.risingauto.com/repository/py-group/simple
  20. # RUN pip install -i https://pypi.douban.com/simple gunicorn mysql-connector mysql
  21. RUN mkdir logs
  22. # 暴露应用端口
  23. EXPOSE 80 5000 5037
  24. # 设置启动命令
  25. #CMD ["gunicorn", "app:app", "-c", "gunicorn.conf.py"]
  26. #CMD ["python", "app.py"]
  27. RUN chmod +x run.sh
  28. CMD ["/bin/bash", "run.sh"]