diff --git a/infra/docker/Dockerfile b/infra/docker/Dockerfile index 22a0f993..da5856c7 100644 --- a/infra/docker/Dockerfile +++ b/infra/docker/Dockerfile @@ -12,23 +12,22 @@ FROM python:3.12-slim AS builder WORKDIR /build +# git is required: pyproject declares a git dependency (iab-agentic-primitives) RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ + git \ && rm -rf /var/lib/apt/lists/* -# Copy only dependency metadata first (cache-friendly) -COPY pyproject.toml ./ - -# Install dependencies into a virtual env so we can copy it cleanly +# Install everything into a virtual env so we can copy it cleanly. +# No separate dependency layer: an editable hatchling build needs the +# source tree present, so a pyproject-only install cannot succeed and +# would only mask failures. RUN python -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" -RUN pip install --no-cache-dir --upgrade pip \ - && pip install --no-cache-dir -e . 2>/dev/null; true - -# Now copy source and install the package itself COPY . . -RUN pip install --no-cache-dir -e . +RUN pip install --no-cache-dir --upgrade pip \ + && pip install --no-cache-dir -e . # --------------------------------------------------------------------------- # Stage 2 — Runtime @@ -53,8 +52,9 @@ COPY --from=builder /build/src ./src COPY --from=builder /build/pyproject.toml ./ COPY --from=builder /build/README.md ./ -# Install the package in the runtime venv -RUN pip install --no-cache-dir -e . +# Re-point the editable install at /app; dependencies already live in the +# copied venv, so skip resolution (which would also need git at runtime) +RUN pip install --no-cache-dir --no-deps -e . # Create data directory for SQLite (owned by non-root user) RUN mkdir -p /app/data && chown buyer:buyer /app/data