FROM python:3.11-slim # OS deps : curl (healthcheck) + libgomp1 (FAISS) RUN apt-get update && apt-get install -y --no-install-recommends \ curl libgomp1 \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Env utiles ENV PORT=7860 \ UI_PATH=/ui \ HF_HUB_DISABLE_TELEMETRY=1 \ MPLCONFIGDIR=/tmp/mpl # Dépendances Python COPY requirements.txt . RUN python -m pip install --upgrade pip \ && pip install --no-cache-dir -r requirements.txt # Code COPY main.py . EXPOSE 7860 # Healthcheck sur /health HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \ CMD curl -fsS "http://localhost:${PORT}/health" || exit 1 CMD ["python", "-u", "/app/main.py"]