Spaces:
Sleeping
Sleeping
paleDriver7
commited on
Commit
•
cb921c1
1
Parent(s):
abde135
Update Dockerfile
Browse files- 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", "
|
|
|
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"]
|