FROM quay.ocp.banorte.com/golden/python-312:latest AS builder COPY --from=ghcr.io/astral-sh/uv:0.7.12 /uv /uvx /bin/ ENV UV_COMPILE_BYTECODE=1 \ UV_NO_CACHE=1 \ UV_NO_DEV=1 \ UV_LINK_MODE=copy WORKDIR /app # Install dependencies first (cached layer as long as lockfile doesn't change) COPY pyproject.toml uv.lock ./ RUN uv lock --upgrade RUN uv sync --locked --no-install-project --no-editable # Copy the rest of the project and install it COPY . . RUN uv lock RUN uv sync --locked --no-editable # --- Final stage: no uv, no build artifacts --- FROM quay.ocp.banorte.com/golden/python-312:latest WORKDIR /app COPY --from=builder /app/.venv /app/.venv COPY --from=builder /app /app COPY config.yaml ./ ENV PATH="/app/.venv/bin:$PATH" CMD ["uvicorn", "va_agent.server:app", "--host", "0.0.0.0", "--port", "8080"]