# ── Stage 1: Python + Playwright ────────────────────────────────────────────
FROM mcr.microsoft.com/playwright/python:v1.44.0-jammy

WORKDIR /app

# System deps
RUN apt-get update && apt-get install -y --no-install-recommends \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Python deps
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Install Playwright browsers
RUN playwright install chromium --with-deps

# Copy source
COPY src/ ./src/
COPY pytest.ini .

ENV PYTHONPATH=/app/src
ENV PYTHONUNBUFFERED=1

CMD ["pytest", "src/tests/", "-v", "--tb=short"]
