FROM python:3.12-slim

# System deps for the backend project (so agent can validate imports/linting)
RUN apt-get update && apt-get install -y --no-install-recommends \
    git \
    curl \
    build-essential \
    default-libmysqlclient-dev \
    pkg-config \
    libmagic1 \
    tesseract-ocr \
    libgl1 \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

# Install shypmate Python deps
COPY requirements.txt /tmp/requirements.txt
# Install shypmate deps + common validation tools baked into the image
RUN pip install --no-cache-dir -r /tmp/requirements.txt ruff && rm /tmp/requirements.txt

# Copy the shypmate framework into the image
# (the repo itself is cloned at runtime, but the framework code is baked in)
COPY . /opt/shypmate
# /opt so `import shypmate.*` works; /workspace for project imports after clone
ENV PYTHONPATH="/opt:/workspace:${PYTHONPATH}"

WORKDIR /workspace

ENTRYPOINT ["python", "/opt/shypmate/entrypoint.py"]
