Chore: Split docker dev and prod build stages#2
Open
regularfry wants to merge 1 commit into
Open
Conversation
This patch makes the Dockerfile build both dev and prod images. If build with `docker build` it will default to building the prod stage, which gives us a place to put development-specific build dependencies. The `dev` stage is mostly an example at the moment: it installs `build-essential` which I wanted for some local `make` tasks, but we may want to add to it in future. One important difference between the `dev` and `prod` stages is that the `prod` stage is configured to run the `gunicorn` server via the script in `management_interface/bin/serve`. I've tweaked the workers and threads to be somewhat sensible values, and for the logs to go to stdout. As long as you're running it through `docker-compose`, the `dev` stage will still run the `django` development server rather than `gunicorn`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 patch makes the Dockerfile build both
devandprodimages. If built withdocker buildit will default to building theprodstage, which gives us a place to put development-specific build dependencies.The
devstage is mostly an example at the moment: it installsbuild-essentialwhich I wanted for some localmaketasks, but we may want to add to it in future.One important difference between the
devandprodstages is that theprodstage is configured to run thegunicornserver via the script inmanagement_interface/bin/servewhich, since it's listed in theDockerfile, I assume we want to use. I've tweaked the workers and threads to be somewhat sensible values, and for the logs to go to stdout.As long as you're running it through
docker-compose, thedevstage will still run thedjangodevelopment server rather thangunicorn.