🔧(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-27 08:49:55 +02:00
parent e747e038f8
commit ef9376368f
2 changed files with 10 additions and 3 deletions
+9 -1
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
@@ -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: