# NOTE: this image depends on `triagekit-mcp-core` resolving from PyPI. Per the core-first
# release order (see CONTRIBUTING.md), this image cannot build successfully until
# triagekit-mcp-core has been published. Not yet verified locally (no Docker available in the
# dev environment this was built in) - verify a real `docker build .` before relying on this.

FROM python:3.12-slim AS build

WORKDIR /app
COPY . .
RUN pip install --no-cache-dir build && python -m build --wheel

FROM python:3.12-slim

RUN useradd --create-home --shell /bin/bash mcp
USER mcp
WORKDIR /home/mcp

COPY --from=build /app/dist/*.whl /tmp/
RUN pip install --no-cache-dir /tmp/*.whl && rm /tmp/*.whl

ENTRYPOINT ["triagekit-mcp-k8s-triage"]
