From d764335741c88012796753e2d4d947228cafa56e Mon Sep 17 00:00:00 2001 From: Guillaume-Sanchez Date: Mon, 29 Jun 2026 21:29:37 +0200 Subject: [PATCH] Remise en place dans un dossier --- Dockerfile | 10 +++++++--- apple-touch-icon.png => app/apple-touch-icon.png | Bin favicon-16x16.png => app/favicon-16x16.png | Bin favicon-32x32.png => app/favicon-32x32.png | Bin index.html => app/index.html | 0 main.py => app/main.py | 0 requirements.txt => app/requirements.txt | 0 site.webmanifest => app/site.webmanifest | 0 docker-compose.yml | 2 +- 9 files changed, 8 insertions(+), 4 deletions(-) rename apple-touch-icon.png => app/apple-touch-icon.png (100%) rename favicon-16x16.png => app/favicon-16x16.png (100%) rename favicon-32x32.png => app/favicon-32x32.png (100%) rename index.html => app/index.html (100%) rename main.py => app/main.py (100%) rename requirements.txt => app/requirements.txt (100%) rename site.webmanifest => app/site.webmanifest (100%) diff --git a/Dockerfile b/Dockerfile index 5fc91b1..a3480d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,11 +2,15 @@ FROM python:3.9-slim 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 -COPY . . +# On copie le code source +COPY app/ . EXPOSE 8000 -CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +# 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"] \ No newline at end of file diff --git a/apple-touch-icon.png b/app/apple-touch-icon.png similarity index 100% rename from apple-touch-icon.png rename to app/apple-touch-icon.png diff --git a/favicon-16x16.png b/app/favicon-16x16.png similarity index 100% rename from favicon-16x16.png rename to app/favicon-16x16.png diff --git a/favicon-32x32.png b/app/favicon-32x32.png similarity index 100% rename from favicon-32x32.png rename to app/favicon-32x32.png diff --git a/index.html b/app/index.html similarity index 100% rename from index.html rename to app/index.html diff --git a/main.py b/app/main.py similarity index 100% rename from main.py rename to app/main.py diff --git a/requirements.txt b/app/requirements.txt similarity index 100% rename from requirements.txt rename to app/requirements.txt diff --git a/site.webmanifest b/app/site.webmanifest similarity index 100% rename from site.webmanifest rename to app/site.webmanifest diff --git a/docker-compose.yml b/docker-compose.yml index b95b023..e66da85 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: ports: - "8000:8000" volumes: - - .:/app + - ./app:/app # On monte le dossier local 'app' vers le conteneur environment: - PYTHONUNBUFFERED=1 networks: