Spaces:
Sleeping
Sleeping
| # Utiliser l'image de base Python 3.9 | |
| FROM python:3.9 | |
| # Créer un utilisateur non-root | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| # Définir le répertoire de travail | |
| WORKDIR /app | |
| # Copier le fichier requirements.txt et installer les dépendances | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Copier le reste de l'application | |
| COPY --chown=user . /app | |
| # Commande pour démarrer l'application | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |