Forrest99 commited on
Commit
e982705
·
verified ·
1 Parent(s): f69c1ee

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -3
Dockerfile CHANGED
@@ -1,6 +1,15 @@
1
- FROM python:3.9-slim # 使用轻量级基础镜像
 
 
 
2
  WORKDIR /app
 
 
3
  COPY requirements.txt .
4
- RUN pip install --no-cache-dir -r requirements.txt # 无缓存安装依赖
 
 
5
  COPY . .
6
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] # 暴露端口 7860
 
 
 
1
+ # 使用官方 Python 镜像
2
+ FROM python:3.9-slim
3
+
4
+ # 设置工作目录
5
  WORKDIR /app
6
+
7
+ # 安装依赖
8
  COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
+
11
+ # 复制代码
12
  COPY . .
13
+
14
+ # 启动命令
15
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]