yuoop commited on
Commit
6a58f05
·
verified ·
1 Parent(s): 414c24c

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -0
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 使用官方 Python 3.11 slim 镜像作为基础镜像
2
+ FROM python:3.11-slim-buster
3
+
4
+ # 设置工作目录
5
+ WORKDIR /app
6
+
7
+ # 将 requirements.txt 文件复制到工作目录
8
+ COPY requirements.txt .
9
+
10
+ # 安装 requirements.txt 中指定的依赖
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # 将应用程序代码复制到工作目录
14
+ COPY . .
15
+
16
+ # 设置环境变量 (可选,但推荐)
17
+ ENV TARGET_DOMAIN="https://api.chatanywhere.tech"
18
+ ENV PORT=8000
19
+
20
+ # 暴露端口
21
+ EXPOSE 8000
22
+
23
+ # 定义启动命令
24
+ CMD ["python", "app.py"]