FROM mcr.microsoft.com/playwright/python:v1.49.1-jammy

WORKDIR /app

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

# Pipeline scripts
COPY config.py mvp_terms.py db_init.py pnp_scraper.py checkers_scraper.py woolworths_scraper.py \
     baskit_match.py load_mysql.py run_pipeline.py ./
COPY v2/ ./v2/

# Ensure data and exports dirs exist in the image
RUN mkdir -p data exports

# v2: scrape as before, push catalogue to Baskit Ops /ingest/v1 (not MySQL-only sink)
CMD ["python", "v2/run_pipeline_v2.py", "--rotate"]
