Get the latest tech news
Switching Pip to Uv in a Dockerized Flask / Django App
I noticed about a 10x speed up across a number of projects, we'll avoid using a venv and run things as a non-root user too.
You only need to add your top level dependencies, uv will make a lock file for you automatically which is somewhat comparable to what pip freeze would produce except uv’s lock file has proper dependency trees and is way better. In both cases I extracted their install commands to a separate script so it’s easy to either run at build time in the Dockerfile (as seen above), or by running it as a command at run-time to make sure your lock file gets updated on your host machine through a volume. ./run deps:install Build a new image and volume mount out a new lock file It’s mainly doing docker compose build and running bin/uv-install inside of a container which has a volume mount so your host’s lock file gets updated
Or read this on Hacker News