ljx77qaq commited on
Commit
2aa9a9b
·
verified ·
1 Parent(s): 59cf212

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -20
Dockerfile CHANGED
@@ -1,27 +1,9 @@
1
- FROM node:20-slim AS frontend-builder
2
-
3
- WORKDIR /app/frontend
4
- COPY frontend/package.json frontend/package-lock.json* ./
5
- RUN npm install
6
- COPY frontend/ ./
7
- RUN npm run build
8
-
9
- # ---- Backend ----
10
  FROM python:3.11-slim
11
 
12
  WORKDIR /app
13
-
14
- # 安装Python依赖
15
- COPY backend/requirements.txt .
16
  RUN pip install --no-cache-dir -r requirements.txt
 
17
 
18
- # 复制后端代码
19
- COPY backend/ .
20
-
21
- # 复制前端构建产物
22
- COPY --from=frontend-builder /app/frontend/dist /app/frontend/dist
23
-
24
- # HF Spaces 使用 7860 端口
25
  EXPOSE 7860
26
-
27
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
1
  FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
+ COPY requirements.txt .
 
 
5
  RUN pip install --no-cache-dir -r requirements.txt
6
+ COPY app.py .
7
 
 
 
 
 
 
 
 
8
  EXPOSE 7860
 
9
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]