This repository has been archived on 2024-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
proxyapi/Dockerfile

34 lines
901 B
Docker
Raw Normal View History

2024-01-15 11:33:52 +08:00
# 基于 Python 官方镜像
FROM python:3.11.6
# 设置工作目录
WORKDIR /app
# 拷贝 Pipfile 和 Pipfile.lock
COPY Pipfile Pipfile.lock /app/
# 安装 Pipenv使用临时的清华大学镜像源
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pipenv
# 安装依赖,同样使用临时的镜像源
RUN pipenv install --deploy --ignore-pipfile -i https://pypi.tuna.tsinghua.edu.cn/simple
2024-01-18 11:22:45 +08:00
# 设置清华大学镜像源以加速安装
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
&& sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
&& apt-get update && apt-get install -y wget
2024-01-18 11:17:32 +08:00
2024-01-15 11:33:52 +08:00
# 拷贝应用代码
COPY . /app
# 设置环境变量
ENV FLASK_APP=app.py
ENV FLASK_RUN_HOST=0.0.0.0
ENV FLASK_ENV=production
# 暴露端口
EXPOSE 5000
# 设置启动命令
CMD ["pipenv", "run", "flask", "run"]