Taylor1998 commited on
Commit
399600a
·
verified ·
1 Parent(s): e748b64

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -5
Dockerfile CHANGED
@@ -1,16 +1,21 @@
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
 
5
- # 安装依赖
 
 
 
6
  COPY requirements.txt .
7
  RUN pip install --no-cache-dir -r requirements.txt
8
 
9
- # 复制代码
10
  COPY . .
11
 
12
- # 暴露端口,HF Space 默认监听 7860
13
  EXPOSE 7860
14
 
15
- # 启动 FastAPI 服务
16
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # 使用官方轻量级 Python 镜像
2
  FROM python:3.10-slim
3
 
4
+ # 设置工作目录
5
  WORKDIR /app
6
 
7
+ # 安装系统依赖 (如有需要)
8
+ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
9
+
10
+ # 复制依赖文件并安装
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
+ # 复制代码到容器
15
  COPY . .
16
 
17
+ # 暴露 Space 默认端口
18
  EXPOSE 7860
19
 
20
+ # 启动命令
21
+ CMD ["python", "app.py"]