Modification adress reseau

This commit is contained in:
Guillaume-Sanchez
2026-06-29 21:32:55 +02:00
parent 51fc71ef80
commit 305929132e
+6 -5
View File
@@ -2,15 +2,16 @@ FROM python:3.9-slim
WORKDIR /app WORKDIR /app
# On copie d'abord le fichier des dépendances depuis le dossier 'app' # Copier et installer les dépendances
COPY app/requirements.txt . COPY app/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
# On copie le code source # Copier le contenu du dossier local 'app' vers le dossier /app du conteneur
COPY app/ . COPY app/ .
# Exposer le port 8000
EXPOSE 8000 EXPOSE 8000
# IMPORTANT : Le module est maintenant à la racine du WORKDIR (/app) # Lancer Uvicorn en ajoutant le répertoire courant au PYTHONPATH
# Uvicorn cherche 'main' à la racine de /app # Cela force Uvicorn à chercher 'main' dans /app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]