From 378faafdf67299371a6335b2d3937b308c6de0ef Mon Sep 17 00:00:00 2001 From: DK09876 Date: Tue, 17 Mar 2026 11:55:10 -0700 Subject: [PATCH] fix: copy uv.lock into Docker build to prevent dependency drift The standalone Dockerfile only copied pyproject.toml but not uv.lock, causing uv sync to resolve dependencies fresh on every build. This broke CI when claude-agent-sdk 0.1.49 was published with only macOS ARM wheels (no Linux x86_64 support), since the Docker build runs on Linux. Now copies uv.lock and uses --frozen --no-install-project to install exact locked versions, preventing unexpected upgrades. Co-Authored-By: Claude Opus 4.6 --- docker/standalone/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docker/standalone/Dockerfile b/docker/standalone/Dockerfile index 71a27a4a..5639ce68 100644 --- a/docker/standalone/Dockerfile +++ b/docker/standalone/Dockerfile @@ -41,19 +41,21 @@ RUN apt-get update && apt-get install -y \ && rm -rf /var/lib/apt/lists/* \ && pip install --no-cache-dir uv -# Copy dependency files and README (required by pyproject.toml) +# Copy dependency files, lockfile, and README (required by pyproject.toml) COPY hindsight-api-slim/pyproject.toml ./api/ COPY hindsight-api-slim/README.md ./api/ +COPY uv.lock ./api/ WORKDIR /app/api # Sync dependencies using appropriate extras based on INCLUDE_LOCAL_MODELS +# Uses --frozen to install exact versions from uv.lock (prevents unexpected upgrades) # local-ml: torch, sentence-transformers, transformers, einops, flashrank, mlx (optional) # embedded-db: pg0-embedded (always included for embedded PostgreSQL support) RUN if [ "$INCLUDE_LOCAL_MODELS" = "true" ]; then \ - uv sync --extra local-ml --extra embedded-db; \ + uv sync --frozen --no-install-project --extra local-ml --extra embedded-db; \ else \ - uv sync --extra embedded-db; \ + uv sync --frozen --no-install-project --extra embedded-db; \ fi # Copy source code (alembic migrations are inside hindsight_api/)