File size: 602 Bytes
0a08f98 d6201ac 0a08f98 1617176 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # 使用官方的Ubuntu 22.04镜像作为基础镜像
FROM ubuntu:22.04
# 设置工作目录为/app
WORKDIR /app
# 将当前目录下的所有文件复制到/app目录下
COPY . /app
# 安装Python 3和pip
RUN apt-get update && apt-get install -y python3 python3-pip
# 安装Flask和Requests库
RUN pip3 install flask requests
# 安装Gunicorn
RUN pip3 install gunicorn
# 设置环境变量FLASK_APP为proxy.py
ENV FLASK_APP=app.py
# 暴露8080端口
EXPOSE 10000
# 运行Gunicorn服务器,绑定0.0.0.0:8080,指定proxy:app为应用入口
CMD ["gunicorn", "-b", "0.0.0.0:10000", "app:app"] |