Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +7 -5
Dockerfile
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
# --- FASE 1: Build del Frontend ---
|
| 2 |
FROM node:18 AS frontend-build
|
| 3 |
WORKDIR /frontend
|
|
|
|
| 4 |
COPY frontend/package*.json ./
|
| 5 |
RUN npm install
|
| 6 |
COPY frontend/ ./
|
|
@@ -16,18 +17,19 @@ RUN apt-get update && apt-get install -y \
|
|
| 16 |
curl \
|
| 17 |
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
|
|
|
|
| 19 |
COPY requirements.txt .
|
| 20 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
-
# Copia il codice
|
| 23 |
COPY . .
|
| 24 |
|
| 25 |
-
# Copia i file
|
| 26 |
COPY --from=frontend-build /frontend/dist /code/static
|
| 27 |
|
| 28 |
-
#
|
| 29 |
ENV PORT=7860
|
| 30 |
EXPOSE 7860
|
| 31 |
|
| 32 |
-
#
|
| 33 |
-
CMD ["python", "-m", uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
# --- FASE 1: Build del Frontend ---
|
| 2 |
FROM node:18 AS frontend-build
|
| 3 |
WORKDIR /frontend
|
| 4 |
+
# Assicurati che la cartella si chiami esattamente 'frontend' nel tuo progetto
|
| 5 |
COPY frontend/package*.json ./
|
| 6 |
RUN npm install
|
| 7 |
COPY frontend/ ./
|
|
|
|
| 17 |
curl \
|
| 18 |
&& rm -rf /var/lib/apt/lists/*
|
| 19 |
|
| 20 |
+
# Installazione dipendenze Python
|
| 21 |
COPY requirements.txt .
|
| 22 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 23 |
|
| 24 |
+
# Copia tutto il codice (incluso api.py e cartelle agentLogic ecc.)
|
| 25 |
COPY . .
|
| 26 |
|
| 27 |
+
# Copia i file statici di React (dist) nella cartella 'static' del backend
|
| 28 |
COPY --from=frontend-build /frontend/dist /code/static
|
| 29 |
|
| 30 |
+
# Configurazione porta Hugging Face
|
| 31 |
ENV PORT=7860
|
| 32 |
EXPOSE 7860
|
| 33 |
|
| 34 |
+
# CORRETTO: Avvio dell'app (fixato virgolette e virgole)
|
| 35 |
+
CMD ["python", "-m", "uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]
|