diff --git a/Dockerfile b/Dockerfile index cac86f3..e8e0b75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ # - Runs a non-root user. # - Sets up the entrypoint and port. -FROM python:3.13.7-slim-bookworm AS base-image +FROM python:3.13.7-slim-trixie AS base-image # Update system packages COPY scripts/install-base-packages.sh . @@ -45,7 +45,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ # Install the application itself. ADD . /app RUN --mount=type=cache,target=/root/.cache/uv \ - uv pip install --no-deps --compile-bytecode . + uv sync --frozen --no-default-groups --compile-bytecode --no-editable FROM base-image AS runtime-image @@ -53,7 +53,7 @@ FROM base-image AS runtime-image RUN useradd --create-home appuser # Copy the virtualenv -COPY --from=install-image /app /app +COPY --from=install-image /app/.venv /app/.venv # Switch to the non-root user. USER appuser diff --git a/scripts/update-uv-version.sh b/scripts/update-uv-version.sh index a950338..776a3e5 100755 --- a/scripts/update-uv-version.sh +++ b/scripts/update-uv-version.sh @@ -17,8 +17,8 @@ uv_version=$(uv export -q --no-hashes --only-group lint \ for f in .github/workflows/*.yaml; do sed "s/UV_VERSION: .*/UV_VERSION: \"$uv_version\"/" "$f" >"$f.n" if ! cmp -s "$f" "${f}.n"; then - echo "Updating UV_VERSION to $uv_version in $f" - mv "${f}.n" "$f" + echo "Updating UV_VERSION to $uv_version in $f" + mv "${f}.n" "$f" else rm "${f}.n" fi @@ -29,7 +29,7 @@ for f in Dockerfile*; do sed "s/uv:[0-9][0-9.]*/uv:$uv_version/" "$f" >"${f}.n" if ! cmp -s "$f" "${f}.n"; then echo "Updating uv container version to $uv_version in $f" - mv "${f}.n" "$f" + mv "${f}.n" "$f" else rm "${f}.n" fi