From 4155b37626d73a74ead908718b3dbf1916e05eae Mon Sep 17 00:00:00 2001 From: Daniel Chalef <131175+danielchalef@users.noreply.github.com> Date: Wed, 29 Oct 2025 19:18:45 -0700 Subject: [PATCH] Fix dependency installation order and optimize FalkorDB install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address additional review concerns: 1. **Fix dependency installation order** - Install server deps first with uv sync, then upgrade graphiti-core to desired PyPI version using --upgrade flag. This prevents stale uv.lock (pinned to 0.13.2) from downgrading our target version. 2. **Optimize FalkorDB installation** - Combine graphiti-core installation with FalkorDB extra in single command, avoiding redundant package reinstall. 3. **Add --upgrade flag** - Ensures the specific PyPI version takes precedence over lockfile version. The installation sequence is now: - uv sync (server deps + graphiti-core 0.13.2 from lock) - uv pip install --upgrade graphiti-core==TARGET_VERSION (upgrades to desired version) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- Dockerfile | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 06095f84..b07e53a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,32 +35,28 @@ ENV UV_COMPILE_BYTECODE=1 \ # Create non-root user RUN groupadd -r app && useradd -r -d /app -g app app -# Install graphiti-core from PyPI -# If GRAPHITI_VERSION is provided, install that specific version; otherwise install latest -RUN --mount=type=cache,target=/root/.cache/uv \ - if [ -n "$GRAPHITI_VERSION" ]; then \ - uv pip install --system "graphiti-core==$GRAPHITI_VERSION"; \ - else \ - uv pip install --system graphiti-core; \ - fi - -# Set up the server application +# Set up the server application first WORKDIR /app COPY ./server/pyproject.toml ./server/README.md ./server/uv.lock ./ COPY ./server/graph_service ./graph_service -# Install server dependencies and application -RUN --mount=type=cache,target=/root/.cache/uv \ - uv sync --frozen --no-dev - -# Install falkordb if requested +# Install server dependencies (without graphiti-core from lockfile) +# Then install graphiti-core from PyPI at the desired version +# This prevents the stale lockfile from pinning an old graphiti-core version ARG INSTALL_FALKORDB=false RUN --mount=type=cache,target=/root/.cache/uv \ - if [ "$INSTALL_FALKORDB" = "true" ]; then \ - if [ -n "$GRAPHITI_VERSION" ]; then \ - uv pip install --system "graphiti-core[falkordb]==$GRAPHITI_VERSION"; \ + uv sync --frozen --no-dev && \ + if [ -n "$GRAPHITI_VERSION" ]; then \ + if [ "$INSTALL_FALKORDB" = "true" ]; then \ + uv pip install --system --upgrade "graphiti-core[falkordb]==$GRAPHITI_VERSION"; \ else \ - uv pip install --system "graphiti-core[falkordb]"; \ + uv pip install --system --upgrade "graphiti-core==$GRAPHITI_VERSION"; \ + fi; \ + else \ + if [ "$INSTALL_FALKORDB" = "true" ]; then \ + uv pip install --system --upgrade "graphiti-core[falkordb]"; \ + else \ + uv pip install --system --upgrade graphiti-core; \ fi; \ fi