FROM python:3.10-slim # Installer les dépendances système RUN apt-get update && apt-get install -y \ build-essential \ cmake \ git \ curl \ && rm -rf /var/lib/apt/lists/* # Installer les dépendances Python COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir huggingface-hub # Créer un utilisateur non-root RUN useradd -m -u 1000 user USER user WORKDIR /home/user # Copier l'application COPY --chown=user:user api.py . COPY --chown=user:user download_model.py . EXPOSE 7860 # Démarrer CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]