# .vibepod/overlay/pi/Dockerfile — no FROM line
# Marker (https://github.com/datalab-to/marker) for the Pi agent.
# NOTE: this per-agent fragment REPLACES ../Dockerfile for pi — copy the pixi
# lines from there if pi should keep pixi too.

# uv via ADD (no curl needed in the base image), pinned for reproducibility.
# x86_64; on an arm64 host use uv-aarch64-unknown-linux-gnu.tar.gz.
ADD https://github.com/astral-sh/uv/releases/download/0.8.17/uv-x86_64-unknown-linux-gnu.tar.gz /tmp/uv.tar.gz
RUN mkdir -p /opt/uv/bin && tar -xzf /tmp/uv.tar.gz -C /opt/uv/bin --strip-components=1 && rm /tmp/uv.tar.gz

# Fixed /opt paths: pi overrides HOME to /config at runtime, so nothing
# marker needs may live under the build-time ~.
ENV UV_PYTHON_INSTALL_DIR=/opt/uv/python

# marker in its own venv with a uv-managed Python. CPU torch wheels
# (--torch-backend=cpu) keep the image several GB smaller than the default
# CUDA build — the container has no GPU anyway.
RUN /opt/uv/bin/uv venv /opt/marker --python 3.12 && \
    /opt/uv/bin/uv pip install --python /opt/marker/bin/python --no-cache \
        --torch-backend=cpu marker-pdf

ENV PATH="/opt/marker/bin:/opt/uv/bin:${PATH}"
