mirror of
https://github.com/suitenumerique/docs
synced 2026-04-21 13:37:20 +00:00
🔧(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:
parent
30ed563be4
commit
5f5ba7e51b
2 changed files with 10 additions and 3 deletions
10
Dockerfile
10
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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue