From 5f5ba7e51bbe2eef6bf28c1552f13c7fb931628a Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 20 Apr 2026 08:57:50 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(docker)=20run=20django=20app=20wit?= =?UTF-8?q?h=20uvicorn=20in=20dev=20environment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The django application is running in ASGI in production, to have the same behavior we run the development container with uvicorn too with options more appropriated for a development evironment. --- Dockerfile | 10 +++++++++- src/helm/env.d/dev/values.impress.yaml.gotmpl | 3 +-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 753bceed..6439b50e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -134,7 +134,15 @@ ENV DB_HOST=postgresql \ DB_PORT=5432 # Run django development server -CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] +CMD [\ + "uvicorn",\ + "--app-dir=/app",\ + "--host=0.0.0.0",\ + "--lifespan=off",\ + "--reload",\ + "--reload-dir=/app",\ + "impress.asgi:application"\ + ] # ---- Production image ---- FROM core AS backend-production diff --git a/src/helm/env.d/dev/values.impress.yaml.gotmpl b/src/helm/env.d/dev/values.impress.yaml.gotmpl index 1c222b1c..143f345a 100644 --- a/src/helm/env.d/dev/values.impress.yaml.gotmpl +++ b/src/helm/env.d/dev/values.impress.yaml.gotmpl @@ -100,10 +100,9 @@ backend: - uvicorn - --app-dir=/app - --host=0.0.0.0 - - --timeout-graceful-shutdown=300 - - --limit-max-requests=20000 - --lifespan=off - --reload + - --reload-dir=/app - "impress.asgi:application" createsuperuser: