FROM python:3.14-slim AS builder

ENV UV_LINK_MODE=copy

COPY --from=ghcr.io/astral-sh/uv:0.11.6 /uv /usr/local/bin/uv

RUN apt-get update \
    && apt-get install -y --no-install-recommends git \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY .git ./.git
COPY pyproject.toml uv.lock README.md ./
COPY src ./src
COPY config ./config

RUN uv build --wheel --out-dir /app/dist

FROM python:3.14-slim

WORKDIR /app

COPY --from=builder /app/dist /app/dist

RUN pip install --no-cache-dir /app/dist/*.whl

CMD ["otelforge", "start", \
     "--profile", "deploy"]
