smgc commited on
Commit
110c7cd
·
verified ·
1 Parent(s): e51f077

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -0
Dockerfile ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 使用官方Python基础镜像
2
+ FROM python:3.9-slim
3
+
4
+ # 设置工作目录
5
+ WORKDIR /app
6
+
7
+ # 复制当前目录下的所有文件到容器的/app目录
8
+ COPY . .
9
+
10
+ # 安装所需的Python库
11
+ RUN pip install --no-cache-dir requests
12
+
13
+ # 设置环境变量(可选)
14
+ ENV PYTHONUNBUFFERED=1
15
+
16
+ # 运行main.py
17
+ CMD ["python", "main.py"]