# nexor-agora hub — FastAPI + static UI. Self-contained (pip, no workspace).
FROM python:3.12-slim

WORKDIR /app

COPY pyproject.toml README.md ./
COPY src/ ./src/

RUN pip install --no-cache-dir .

ENV NEXOR_AGORA_HOST=0.0.0.0 \
    NEXOR_AGORA_PORT=8400 \
    NEXOR_AGORA_LOG_LEVEL=INFO

EXPOSE 8400

HEALTHCHECK --interval=15s --timeout=5s --retries=5 --start-period=15s \
    CMD python -c "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8400/api/v1/health').status==200 else 1)" || exit 1

CMD ["python", "-m", "nexor_agora", "serve"]
