next-playground commited on
Commit
d696393
·
verified ·
1 Parent(s): af76885

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -0
Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 使用官方 Python 运行时作为父镜像
2
+ FROM python:3.10
3
+
4
+ # 设置工作目录
5
+ WORKDIR /app
6
+
7
+ # 将代码复制到容器中
8
+ COPY . /app
9
+
10
+ # 安装依赖
11
+ RUN pip install --no-cache-dir gunicorn
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # 暴露端口
15
+ EXPOSE 5000
16
+
17
+ # 运行应用程序
18
+ CMD ["gunicorn", "-b", "0.0.0.0:5000", "--timeout", "300", "app:app"]