paleDriver7 commited on
Commit
cb921c1
1 Parent(s): abde135

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -3
Dockerfile CHANGED
@@ -13,12 +13,12 @@ COPY frontend/ .
13
  RUN npm run build
14
 
15
  # 阶段 2:运行后端 + 提供前端静态资源
16
- FROM python:3.9
17
  WORKDIR /app
18
 
19
  # 后端依赖
20
  COPY backend/requirements.txt ./backend/requirements.txt
21
- RUN pip install -r backend/requirements.txt
22
 
23
  # 拷贝后端代码
24
  COPY backend/ ./backend/
@@ -27,4 +27,4 @@ COPY backend/ ./backend/
27
  COPY --from=frontend-build /app/frontend/dist ./frontend_dist
28
 
29
  # 启动命令:运行后端,同时提供静态文件
30
- CMD ["gunicorn", "backend.app:app", "--host", "0.0.0.0", "--port", "7860"]
 
13
  RUN npm run build
14
 
15
  # 阶段 2:运行后端 + 提供前端静态资源
16
+ FROM python:3.9-slim
17
  WORKDIR /app
18
 
19
  # 后端依赖
20
  COPY backend/requirements.txt ./backend/requirements.txt
21
+ RUN pip install --no-cache-dir -r backend/requirements.txt
22
 
23
  # 拷贝后端代码
24
  COPY backend/ ./backend/
 
27
  COPY --from=frontend-build /app/frontend/dist ./frontend_dist
28
 
29
  # 启动命令:运行后端,同时提供静态文件
30
+ CMD ["gunicorn", "-b", "0.0.0.0:7860", "backend.app:app"]