# we use debian because there are no simpleitk wheels for musl and building
# them is a hassle

FROM ghcr.io/astral-sh/uv:python3.13-trixie-slim AS builder

ENV UV_LINK_MODE=copy
RUN apt-get update \
  && apt-get install -y --no-install-recommends git \
  && rm -rf /var/lib/apt/lists/*
COPY pyproject.toml uv.lock ./
RUN uv sync --all-groups --all-extras --no-install-project

FROM ghcr.io/astral-sh/uv:python3.13-trixie-slim AS ci

ENV UV_LINK_MODE=copy
RUN apt-get update \
  && apt-get install -y --no-install-recommends git \
  && rm -rf /var/lib/apt/lists/*
COPY --from=builder /root/.cache/uv /root/.cache/uv
COPY pyproject.toml uv.lock ./
