# Dockerfile — Python runner for the Day-1 RAG evaluation + failure-modes lab
# Base image pinned by index-digest (ADR-6).
# Re-resolve: docker buildx imagetools inspect python:3.12-slim --format '{{.Manifest.Digest}}'
FROM python:3.12-slim@sha256:423ed6ab25b1921a477529254bfeeabf5855151dc2c3141699a1bfc852199fbf

WORKDIR /workspace

# curl: for debugging convenience (e.g. testing endpoints from inside the container).
# The Chroma healthcheck uses Python's stdlib urllib (not curl) — curl is absent in
# the chromadb/chroma image and cannot be relied on there.
RUN apt-get update \
    && apt-get install -y --no-install-recommends curl \
    && rm -rf /var/lib/apt/lists/*

# Install Python deps first (layer-cached unless requirements.txt changes)
COPY app/requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Bake app + data + prompts so the image works standalone (compose mounts override at runtime)
COPY app/ ./app/
COPY data/ ./data/
COPY prompts/ ./prompts/

CMD ["python", "app/rag_eval.py"]
