# Premium ETL — container สำหรับ Google Cloud Run
# Cloud Scheduler ยิง HTTP มาที่ฟังก์ชัน run() (ผ่าน functions-framework)
FROM python:3.12-slim

ENV PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1
WORKDIR /app

COPY requirements.txt .
RUN pip install -r requirements.txt
# เปิดบรรทัดนี้เฉพาะถ้าใช้ Playwright fallback จริง (เพิ่มขนาด image):
# RUN playwright install --with-deps chromium

# bundle ไฟล์เฟส 1 + 2 + 3 รวมกัน (connectors/models/extract_all/quality/loader/main/utils)
COPY . .

ENV PORT=8080
CMD exec functions-framework --target=run --port=${PORT}
