mirror of
https://github.com/suitenumerique/docs.git
synced 2026-04-25 17:15:01 +02: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:
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:
|
||||
|
||||
Reference in New Issue
Block a user