# Eval runner Docker image
# Based on backend/Dockerfile but optimized for batch evaluation

FROM python:3.12-slim

# System dependencies for Playwright + Xvfb
RUN apt-get update && apt-get install -y \
    wget gnupg ca-certificates git curl \
    fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 \
    libcups2 libdbus-1-3 libdrm2 libgbm1 libgtk-3-0 libnspr4 libnss3 \
    libxcomposite1 libxdamage1 libxfixes3 libxkbcommon0 libxrandr2 xdg-utils \
    xvfb \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Install uv
RUN pip install uv

# Copy project files
COPY pyproject.toml .
COPY src/ src/
COPY README.md .
ENV SETUPTOOLS_SCM_PRETEND_VERSION=0.2.94
RUN uv pip install -e . --system

# Install Playwright
RUN playwright install chromium && playwright install-deps chromium

ENV PLAYWRIGHT_BROWSERS_PATH=/root/.cache/ms-playwright

# Copy eval pipeline
COPY infra/eval/pipelines/ infra/eval/pipelines/
COPY stress-tests/ stress-tests/

WORKDIR /app

ENTRYPOINT ["python", "-m", "infra.eval.pipelines.eval_benchmark"]
