| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Dépendances système | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Dépendances Python | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Copie des fichiers | |
| COPY . . | |
| # Utilisateur non-root requis par HuggingFace Spaces | |
| RUN useradd -m -u 1000 user | |
| RUN chown -R user:user /app | |
| USER user | |
| # Port obligatoire pour HF Spaces | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] |