Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
File size: 833 Bytes
38a3c61 f430808 38a3c61 f430808 38a3c61 f430808 38a3c61 efe827a 38a3c61 d3f8823 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# 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"]
|