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

Merged
merged 4 commits into from
Nov 18, 2024
Merged

Docker file refactor #1066

merged 4 commits into from
Nov 18, 2024

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
@mitchdawson1982 mitchdawson1982 merged commit 395a902 into main Nov 18, 2024
13 checks passed
@mitchdawson1982 mitchdawson1982 deleted the docker-file-refactor branch November 18, 2024 10:22
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.

3 participants