Reduce dockerfile-dev build time in half with uv
and pnpm
#4904
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.
Any background context you want to provide?
I started using
uv
locally to replacepip
and noticed that it reduces the time to install packages by about half. Additionally, I noticed that when the dockerfile is built, that thepip install -r requirements/local.txt
step was taking most of the time.What's this PR do?
I looked up how to switch to
uv
frompip
and implemented those changes. I also looked up if there was an equivalent speed up that can happen for replacingnpm install
and tried usingpnpm
. These changes are only included in the dockerfile-dev file since likely needs to be rebuilt the most often compared to dockerfile which is used for deploying seed.How should this be manually tested?
Switch to the branch and use the following command:
docker-compose stop && docker-compose rm -f && docker-compose -f docker-compose.yml -f docker-compose.dev.yml build
and see how long the build process takes. For me it was about 150 seconds compared to about 300 seconds on the develop branch.What are the relevant tickets?
Screenshots (if appropriate)