Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +4 -5
Dockerfile
CHANGED
|
@@ -3,7 +3,7 @@ FROM python:3.10-slim AS backend
|
|
| 3 |
WORKDIR /app
|
| 4 |
COPY backend/requirements.txt .
|
| 5 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 6 |
-
COPY backend/ ./
|
| 7 |
|
| 8 |
######################## 2) FRONTEND ########################
|
| 9 |
FROM node:18-alpine AS frontend
|
|
@@ -11,7 +11,7 @@ WORKDIR /app/frontend
|
|
| 11 |
COPY frontend/package*.json ./
|
| 12 |
RUN npm ci
|
| 13 |
COPY frontend/ .
|
| 14 |
-
RUN npm run build
|
| 15 |
|
| 16 |
######################## 3) FINAL IMAGE ########################
|
| 17 |
FROM python:3.10-slim
|
|
@@ -20,9 +20,8 @@ WORKDIR /app
|
|
| 20 |
# --- bin + libs Python (включая uvicorn) ---
|
| 21 |
COPY --from=backend /usr/local /usr/local
|
| 22 |
|
| 23 |
-
# --- исходники backend ---
|
| 24 |
-
COPY --from=backend /app/
|
| 25 |
-
COPY backend/*.py /app/ # ← ДОБАВЬТЕ ЭТУ СТРОКУ
|
| 26 |
|
| 27 |
# --- статический фронт ---
|
| 28 |
COPY --from=frontend /app/frontend/.next /app/frontend/.next
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
COPY backend/requirements.txt .
|
| 5 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 6 |
+
COPY backend/ ./
|
| 7 |
|
| 8 |
######################## 2) FRONTEND ########################
|
| 9 |
FROM node:18-alpine AS frontend
|
|
|
|
| 11 |
COPY frontend/package*.json ./
|
| 12 |
RUN npm ci
|
| 13 |
COPY frontend/ .
|
| 14 |
+
RUN npm run build # создаёт /.next
|
| 15 |
|
| 16 |
######################## 3) FINAL IMAGE ########################
|
| 17 |
FROM python:3.10-slim
|
|
|
|
| 20 |
# --- bin + libs Python (включая uvicorn) ---
|
| 21 |
COPY --from=backend /usr/local /usr/local
|
| 22 |
|
| 23 |
+
# --- исходники backend (включая items.py) ---
|
| 24 |
+
COPY --from=backend /app/ /app/
|
|
|
|
| 25 |
|
| 26 |
# --- статический фронт ---
|
| 27 |
COPY --from=frontend /app/frontend/.next /app/frontend/.next
|