# Remote iVolatility data MCP connector (streamable-http) for self-hosting (k8s).
# Build context = mcp/ directory.
FROM python:3.12-slim

WORKDIR /app

# Runtime deps (same set as pyproject.toml). Pinned-light; tighten later.
RUN pip install --no-cache-dir \
    "mcp>=1.27.0" \
    "certifi>=2026.2.25" \
    "httpx>=0.28.1" \
    "numpy>=2.4.4" \
    "python-dotenv>=1.2.2" \
    "pydantic>=2.12.5" \
    "sqlglot>=30.4.0" \
    "pyyaml>=6.0"

# Source layout (engine + connector wrapper incl. bundled index/instructions).
COPY src /app/src

ENV PYTHONPATH=/app/src \
    MCP_TRANSPORT=streamable-http \
    MCP_HOST=0.0.0.0 \
    MCP_PORT=8000
# IVOL_API_KEY is provided at deploy time (k8s secret / env) — NEVER baked in.

EXPOSE 8000

CMD ["python", "-m", "mcp_ivolatility_data"]
