Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +7 -7
Dockerfile
CHANGED
|
@@ -1,20 +1,20 @@
|
|
| 1 |
-
#
|
| 2 |
FROM node:20-slim AS frontend
|
| 3 |
WORKDIR /app
|
| 4 |
-
COPY
|
| 5 |
RUN npm install
|
| 6 |
-
COPY
|
| 7 |
RUN npm run build
|
| 8 |
|
| 9 |
-
#
|
| 10 |
FROM python:3.11-slim
|
| 11 |
WORKDIR /app
|
| 12 |
|
| 13 |
-
COPY
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
-
COPY
|
| 17 |
COPY --from=frontend /app/dist ./static
|
| 18 |
|
| 19 |
EXPOSE 7860
|
| 20 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Étape 1 : Build du frontend React
|
| 2 |
FROM node:20-slim AS frontend
|
| 3 |
WORKDIR /app
|
| 4 |
+
COPY package*.json ./
|
| 5 |
RUN npm install
|
| 6 |
+
COPY . .
|
| 7 |
RUN npm run build
|
| 8 |
|
| 9 |
+
# Étape 2 : Backend Python + fichiers statiques
|
| 10 |
FROM python:3.11-slim
|
| 11 |
WORKDIR /app
|
| 12 |
|
| 13 |
+
COPY requirements.txt .
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
+
COPY main.py .
|
| 17 |
COPY --from=frontend /app/dist ./static
|
| 18 |
|
| 19 |
EXPOSE 7860
|
| 20 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|