FROM python:3.11-slim # Ajustes básicos de Python ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Directorio de trabajo WORKDIR /app # Dependencias del sistema (ajusta si luego te falta algo tipo faiss, etc.) RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ && rm -rf /var/lib/apt/lists/* # Instalar dependencias de Python COPY requirements.txt . RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Copiar el resto del proyecto COPY . . # Puerto que usará la Space (HF inyecta $PORT, normalmente 7860) ENV PORT=7860 EXPOSE 7860 # Lanzar backend (FastAPI) y luego frontend (Streamlit) CMD uvicorn app.api_server:app --host 0.0.0.0 --port 8000 & \ sleep 3 && \ streamlit run app/app_front.py \ --server.port ${PORT} \ --server.address 0.0.0.0