# ── SenpAI Market-Data Consumer ─────────────────────────────────────────
FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1

WORKDIR /app

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

COPY senpai/ ./senpai/
COPY pyproject.toml .

HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 \
    CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8892/health')" || exit 1

EXPOSE 8892

ENTRYPOINT ["python", "-m", "senpai.md_consumer"]
