SYS-706: Add gunicorn and whitenoise for production support #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds, enables and configures two modules:
runserver
)gunicorn
)Neither of these modules is intended for use during development. A new script has been added,
docker_scripts/entrypoint.sh
, which performs different actions based on the run-time environment. This script replaces the dev-onlyrunserver
in the Django image'sDockerfile
.This also adds automatic creation of a default
admin
Django superuser, in dev mode only, for convenience. It can be used by developers, or ignored if you've already set up your own locally.The changes are all infrastructure. I've tested extensively locally, both with
DJANGO_RUN_ENV=dev
andDJANGO_RUN_ENV=prod
. But the easiest way to test locally:SYS-706/gunicorn
docker_scripts/entrypoint.sh
, changing the=
to!=
on line 28docker-compose up --build
- a fresh build is needed sinceDockerfile
changeddocker-compose down
- or if CTRL-C was used, rundocker-compose down
afterwards anyhow.docker-compose ps
should show no running containers when done.docker_scripts/entrypoint.sh
on line 28If all looks good, this PR can be merged.