next-playground commited on
Commit
4a6d5dc
1 Parent(s): 07123f3

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -0
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 使用官方 Python 运行时作为父镜像
2
+ FROM python:3.10
3
+
4
+ # 解决缓存报错问题
5
+ ENV NUMBA_CACHE_DIR /tmp
6
+
7
+ # 设置工作目录
8
+ WORKDIR /app
9
+
10
+ # 将代码复制到容器中
11
+ COPY . /app
12
+
13
+ # 安装依赖
14
+ RUN apt-get update && apt-get install ffmpeg -y
15
+ RUN pip install --no-cache-dir gunicorn
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
+ RUN pip install --no-cache-dir flask
18
+
19
+ # 暴露端口
20
+ EXPOSE 1145
21
+
22
+ # 运行应用程序
23
+ CMD ["gunicorn", "-b", "0.0.0.0:1145", "--timeout", "300", "flask_api_full_song:app"]