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