# Intellign MCP server — deterministic container for Railway (mcp.intellign.ai).
# Railway auto-detects this Dockerfile; remove any custom build/start command
# overrides in the service settings (the image's CMD is the start command).
FROM python:3.12-slim

WORKDIR /app

# Build from the repo source so every push deploys exactly what's committed.
# (Alternative: RUN pip install --no-cache-dir "intellign[mcp]==0.1.0")
COPY pyproject.toml README.md LICENSE ./
COPY src ./src
RUN pip install --no-cache-dir ".[mcp]"

ENV PORT=8001
EXPOSE 8001

# --stateless: no in-process session affinity → safe to run >1 replica.
# Do NOT set INTELLIGN_API_KEY on the public deployment (multi-tenant via
# per-request Authorization headers). Set INTELLIGN_BASE_URL to the API.
CMD intellign-mcp --transport http --host 0.0.0.0 --port ${PORT} --stateless
