Skip to content

Chore: Split docker dev and prod build stages#2

Open
regularfry wants to merge 1 commit into
mainfrom
docker-tweaks
Open

Chore: Split docker dev and prod build stages#2
regularfry wants to merge 1 commit into
mainfrom
docker-tweaks

Conversation

@regularfry

Copy link
Copy Markdown
Contributor

This patch makes the Dockerfile build both dev and prod images. If built 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 which, since it's listed in the Dockerfile, 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, the dev stage will still run the django development server rather than gunicorn.

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`.
@regularfry regularfry changed the title Split docker dev and prod build stages Chore: Split docker dev and prod build stages Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant