File size: 451 Bytes
e02dc9e bd4c5a7 e02dc9e bd4c5a7 e02dc9e 15b42c0 bd4c5a7 f354cd2 fb8dcda 387ac68 e02dc9e e87bba9 bd4c5a7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# 使用官方 Python 运行时作为父镜像
FROM python:3.10-slim
# 设置工作目录
WORKDIR /tmp/app
# 将代码复制到容器中
COPY . /tmp/app
# 安装依赖
RUN pip install --no-cache-dir gunicorn
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install 'numpy==1.26.4'
# 准备文件夹
RUN mkdir separated
# 暴露端口
EXPOSE 5000
# 运行应用程序
CMD ["gunicorn", "-b", "0.0.0.0:5000","--timeout", "300", "app:app"] |