Skip to content

Added UV to the base image, so that we can use uv pip install in prod#257

Merged
pSpitzner merged 4 commits intorelease/2.0.0from
docker_tweaks
Jan 8, 2026
Merged

Added UV to the base image, so that we can use uv pip install in prod#257
pSpitzner merged 4 commits intorelease/2.0.0from
docker_tweaks

Conversation

@pSpitzner
Copy link
Owner

  • This might already fix entrypoint_user_scripts.sh: ensure pip runs in venv #256
  • Users should use uv pip install instead of pip install in automatic startup scripts (using native pip wont install to the correct location, uv pip will - maybe we want to remove native pip to avoid confusion?)
  • It's way faster and feels more consistent to me, since we rely on uv quite heavily now.
  • I confirmed that beets_flask can now be imported when running python inside the container (was broken previously, needed activating the venv), both in prod and dev

@edgar-vincent
Copy link

This fixes #256 here! Thanks a lot!

@semohr
Copy link
Collaborator

semohr commented Jan 7, 2026

Could you verify that we are not shipping two python executables? I have the feeling that we might have some duplicate executables in our docker image since we copy the uv stuff.

@pSpitzner
Copy link
Owner Author

Looks fine to me:

> beetle@beets-container-dev:/repo$ ls -1alh ./backend/.venv/bin/ | grep python
lrwxrwxrwx 1   1000   1000   22 Jan  7 22:07 python -> /usr/local/bin/python3
lrwxrwxrwx 1   1000   1000    6 Jan  7 22:07 python3 -> python
lrwxrwxrwx 1   1000   1000    6 Jan  7 22:07 python3.12 -> python

> beetle@beets-container-dev:/repo$ uv python list
cpython-3.15.0a3-linux-aarch64-gnu                 <download available>
cpython-3.15.0a3+freethreaded-linux-aarch64-gnu    <download available>
cpython-3.14.2-linux-aarch64-gnu                   <download available>
cpython-3.14.2+freethreaded-linux-aarch64-gnu      <download available>
cpython-3.13.11-linux-aarch64-gnu                  <download available>
cpython-3.13.11+freethreaded-linux-aarch64-gnu     <download available>
cpython-3.12.12-linux-aarch64-gnu                  /usr/local/bin/python3.12
cpython-3.12.12-linux-aarch64-gnu                  /usr/local/bin/python3 -> python3.12
cpython-3.12.12-linux-aarch64-gnu                  /usr/local/bin/python -> python3
cpython-3.12.12-linux-aarch64-gnu                  <download available>
cpython-3.11.14-linux-aarch64-gnu                  <download available>
cpython-3.10.19-linux-aarch64-gnu                  <download available>
cpython-3.9.25-linux-aarch64-gnu                   <download available>
cpython-3.8.20-linux-aarch64-gnu                   <download available>
pypy-3.11.13-linux-aarch64-gnu                     <download available>
pypy-3.10.16-linux-aarch64-gnu                     <download available>
pypy-3.9.19-linux-aarch64-gnu                      <download available>
pypy-3.8.16-linux-aarch64-gnu                      <download available>
graalpy-3.12.0-linux-aarch64-gnu                   <download available>
graalpy-3.11.0-linux-aarch64-gnu                   <download available>
graalpy-3.10.0-linux-aarch64-gnu                   <download available>
graalpy-3.8.5-linux-aarch64-gnu                    <download available>

# Remove pip to avoid confusion (force users to use `uv pip install`)
RUN rm -f /usr/local/bin/pip /usr/local/bin/pip3
RUN rm -rf /root/.cache/pip
RUN echo '#!/bin/sh\n\
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart!

@pSpitzner pSpitzner merged commit e75effc into release/2.0.0 Jan 8, 2026
2 checks passed
@pSpitzner pSpitzner deleted the docker_tweaks branch January 8, 2026 19:12
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