Remise en place dans un dossier

This commit is contained in:
Guillaume-Sanchez
2026-06-29 21:29:37 +02:00
parent 2aad2e65cc
commit d764335741
9 changed files with 8 additions and 4 deletions
+7 -3
View File
@@ -2,11 +2,15 @@ FROM python:3.9-slim
WORKDIR /app WORKDIR /app
COPY requirements.txt . # On copie d'abord le fichier des dépendances depuis le dossier 'app'
COPY app/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
COPY . . # On copie le code source
COPY app/ .
EXPOSE 8000 EXPOSE 8000
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] # IMPORTANT : Le module est maintenant à la racine du WORKDIR (/app)
# Uvicorn cherche 'main' à la racine de /app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Before

Width:  |  Height:  |  Size: 902 B

After

Width:  |  Height:  |  Size: 902 B

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File
View File
+1 -1
View File
@@ -6,7 +6,7 @@ services:
ports: ports:
- "8000:8000" - "8000:8000"
volumes: volumes:
- .:/app - ./app:/app # On monte le dossier local 'app' vers le conteneur
environment: environment:
- PYTHONUNBUFFERED=1 - PYTHONUNBUFFERED=1
networks: networks: