Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions infra/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading