File size: 577 Bytes
d696393
 
 
 
 
 
 
 
 
 
04ed24f
d696393
 
5cdd4f4
d696393
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 使用官方 Python 运行时作为父镜像
FROM python:3.10

# 设置工作目录
WORKDIR /app

# 将代码复制到容器中
COPY . /app

# 安装依赖
RUN apt update & apt install software-properties-common & add-apt-repository "deb http://archive.debian.org/debian jessie-backports main" & apt update & apt install ffmpeg
RUN pip install --no-cache-dir gunicorn
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir flask

# 暴露端口
EXPOSE 5000

# 运行应用程序
CMD ["gunicorn", "-b", "0.0.0.0:5000", "--timeout", "300", "app:app"]