Spaces:
Running
Running
File size: 1,092 Bytes
613af91 121cd9d 613af91 121cd9d 613af91 121cd9d 0b6e2d5 121cd9d 613af91 0b6e2d5 7eb8d70 0b6e2d5 7eb8d70 0b6e2d5 9f655fe 0b6e2d5 9f655fe 0b6e2d5 9f655fe 613af91 9f655fe 0b6e2d5 9f655fe |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# --- FASE 1: Build del Frontend ---
FROM node:20 AS frontend-build
WORKDIR /frontend
COPY frontend/package*.json ./
# Installiamo le dipendenze forzando react-markdown
RUN npm install
COPY frontend/ ./
# MODIFICA: saltiamo il controllo TypeScript (tsc) e facciamo solo vite build
RUN npx vite build
# --- FASE 2: Build del Backend (Resta uguale) ---
FROM python:3.10-slim
WORKDIR /code
# Installazione dipendenze di sistema
RUN apt-get update && apt-get install -y \
build-essential \
curl \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Installazione dipendenze Python
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copia tutto il codice (incluso api.py e cartelle agentLogic ecc.)
COPY . .
# Copia i file statici di React (dist) nella cartella 'static' del backend
COPY --from=frontend-build /frontend/dist /code/static
# Configurazione porta Hugging Face
ENV PORT=7860
EXPOSE 7860
# CORRETTO: Avvio dell'app (fixato virgolette e virgole)
CMD ["python", "-m", "uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"] |