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

Tidy up dockerfile #210

Conversation

NotActuallyTerry
Copy link
Contributor

This PR rearranges & tidies up the Dockerfile to achieve a few things:

  • Avoids longer rebuilds on code change by copying the pipfile in, running install, then copying the code in
  • Significantly reduces the image size by removing unnecessary development libraries
  • Fixes up a few warnings thrown by buildx

Testing locally, a fresh build now takes 7 seconds less (31s vs 38s) & uses less than 25% of the space (296MB vs 1.38GB)

By moving the COPY command under the apk command, the package installation no longer runs on every change
We should install pipenv before copying any files, as its outcome won't be changed by any file updates.
Additionally, copying only the pipfiles in then running pipenv install before copying the rest of the project helps prevent rebuilds.
pip pulls down pre-compiled versions of all the required packages, so we don't need to build anything locally.
@primetheus primetheus added the enhancement New feature or request label Aug 22, 2024
@primetheus
Copy link
Collaborator

thanks for this @NotActuallyTerry! 🎉

@primetheus primetheus merged commit 5bced2b into 3rd-party-integrations:main Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants