Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker file refactor #1066

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Docker file refactor #1066

wants to merge 4 commits into from

Conversation

MatMoore
Copy link
Contributor

@MatMoore MatMoore commented Nov 15, 2024

#1038

  • Image size has gone from 497MB to 221MB uncompressed.
  • Build time with --no-cache has gone from 89s to 56s locally (45s on CI)
  • compilemessages is now run at the end of the dockerfile, following collectstatic, which simplifies the earlier build stages
  • There are now environment variables for user/group.

This reduces the build time from 89s to 70s. Final runtime image is
unchanged.
compilemessages depends on the whole Django app, whereas the poetry
install doesn't, so moving this into the runtime image should simplify that
initial build stage and makes it more cachable.

This doesn't affect the overall build time without cache. The gettext
package adds about 8mb to the final image.
This refactor simplifies the runtime image stage and limits
the files copied into the image.

This halves the image size from 505MB to 221MB, and reduces the build
time from 70s to 56s when cache is not used.
@MatMoore MatMoore requested a review from a team as a code owner November 15, 2024 12:32
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.

2 participants