Skip to content

Commit 62c3010

Browse files
committed
Fix Dockerfile.baseimage for uv workspace
The base image build also runs 'uv sync --frozen --no-install-project' but only copies uv.lock + the root pyproject.toml. With the workspace introduced in this PR, uv needs each member's pyproject.toml to resolve. Mirror the change made to docker/Dockerfile: copy the workspace member manifests (but not their source) into the cache layer, switch to --no-install-workspace, and clean the packages/ dir at the end of the RUN like we already do for pyproject.toml/uv.lock.
1 parent 11ff936 commit 62c3010

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

docker/Dockerfile.baseimage

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,18 @@ RUN useradd -ms /bin/bash -U palace && \
6060

6161
WORKDIR /var/www/circulation
6262
COPY --chown=palace:palace uv.lock pyproject.toml /var/www/circulation/
63+
# Workspace-member pyproject.toml files are needed for uv sync to resolve the
64+
# workspace; we copy just the manifests (not the source) so this layer doesn't
65+
# get invalidated by source changes.
66+
COPY --chown=palace:palace packages/palace-util/pyproject.toml /var/www/circulation/packages/palace-util/
67+
COPY --chown=palace:palace packages/palace-opds/pyproject.toml /var/www/circulation/packages/palace-opds/
6368

6469
# Setup virtualenv and install our python dependencies.
6570
# What we install is based on the uv.lock file in the repo at the time this
6671
# image is built. These may get out of date, but we always rerun this step when
6772
# building the final image, so it will be up to date then. This gives is a base
6873
# to work from which speeds up the final image build.
69-
RUN uv sync --frozen --no-dev --no-install-project && \
74+
RUN uv sync --frozen --no-dev --no-install-workspace && \
7075
SIMPLIFIED_ENVIRONMENT=/var/www/circulation/environment.sh && \
7176
echo "if [ -f $SIMPLIFIED_ENVIRONMENT ]; then source $SIMPLIFIED_ENVIRONMENT; fi" >> env/bin/activate && \
7277
. env/bin/activate && \
@@ -76,5 +81,6 @@ RUN uv sync --frozen --no-dev --no-install-project && \
7681
rm -Rf /root/.cache && \
7782
rm pyproject.toml && \
7883
rm uv.lock && \
84+
rm -rf packages && \
7985
rm -rf /root/.cache && \
8086
/bd_build/cleanup.sh

0 commit comments

Comments
 (0)