mattcracker commited on
Commit
c24f398
·
verified ·
1 Parent(s): 3ac8683

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -0
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /code
4
+
5
+ # 安装系统依赖
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ git \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # 复制依赖文件
12
+ COPY requirements.txt .
13
+
14
+ # 安装依赖
15
+ RUN pip install --no-cache-dir -r requirements.txt
16
+
17
+ # 复制应用代码
18
+ COPY . .
19
+
20
+ # 设置环境变量
21
+ ENV PORT=7860
22
+
23
+ # 启动命令
24
+ CMD python app.py