🔧(docker) run django app with uvicorn in dev environment

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.
This commit is contained in:
Manuel Raynaud 2026-04-20 08:57:50 +02:00
parent 30ed563be4
commit 5f5ba7e51b
No known key found for this signature in database
GPG key ID: 3F45EEDEBF44E874
2 changed files with 10 additions and 3 deletions

View file

@ -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

View file

@ -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: