# Installed package only; no source checkout, Task or runtime network requirement.
ARG PYTHON_IMAGE=python:3.12.12-slim-bookworm
FROM ${PYTHON_IMAGE} AS python-base

# Reuse the released native development tools; Reporter keeps its own editable environment.
FROM ghcr.io/living-proof-labs/livingproof:2.8.4-development@sha256:3e355c011ef3ba38733fad880f5b785cea72a3dc511d7eb11cbf79e2fc753f03 AS development
ENV UV_PROJECT_ENVIRONMENT=/tmp/report-venv UV_CACHE_DIR=/tmp/report-uv-cache
ENV PATH="/tmp/report-venv/bin:${PATH}" LIVINGPROOF_REPORTER_DEVELOPMENT=1
WORKDIR /workspace/report
CMD ["sleep", "infinity"]

FROM python-base AS runtime
ARG VERSION
LABEL org.opencontainers.image.source="https://github.com/Living-Proof-Labs/livingproof-capability-report"
LABEL org.opencontainers.image.version="${VERSION}"
COPY dist/wheels/ /tmp/wheels/
RUN python -m venv /opt/report && /opt/report/bin/pip install --no-index --find-links=/tmp/wheels "livingproof-capability-report==${VERSION}" && rm -rf /tmp/wheels
ENV PATH="/opt/report/bin:${PATH}"
WORKDIR /data
ENTRYPOINT ["livingproof-capability-report"]
CMD ["--help"]
