FROM python:3.11-slim WORKDIR /app # System dependencies RUN apt-get update && apt-get install -y \ gcc \ g++ \ git \ && rm -rf /var/lib/apt/lists/* # Install CPU-only torch FIRST (évite de télécharger la version GPU 2GB) RUN pip install --no-cache-dir torch==2.3.0 --index-url https://download.pytorch.org/whl/cpu # Install requirements COPY requirements_hf.txt . RUN pip install --no-cache-dir -r requirements_hf.txt COPY . . # HF Spaces utilise le port 7860 obligatoirement EXPOSE 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]