Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
# Utiliser une image de base Python | |
FROM python:3.9-slim | |
# Définir le répertoire de travail | |
WORKDIR /app | |
# Copier les fichiers de dépendances | |
RUN useradd -m -u 1000 user | |
COPY --chown=user ./requirements.txt requirements.txt | |
# Installer les dépendances | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copier le reste de l'application | |
COPY --chown=user . /app | |
USER user | |
ENV HOME=/home/user \ | |
PATH="/home/user/.local/bin:$PATH" | |
# Exposer le port sur lequel l'application va tourner | |
EXPOSE 7860 | |
# RUN --mount=type=secret,id=api_read,mode=0444,required=true \ | |
# cat /run/secrets/api_read > /secret | |
# RUN --mount=type=secret,id=api_read,mode=0444,required=true \ | |
# git clone $(cat /run/secrets/api_read) | |
# Commande pour lancer l'application | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |