FROM python:3.12-slim

WORKDIR /app

# Install uv for fast dependency management
COPY --from=ghcr.io/astral-sh/uv:0.7 /uv /usr/local/bin/uv

# Copy dependency files first for layer caching
COPY pyproject.toml uv.lock ./

# Install dependencies
RUN uv sync --frozen --no-dev

# Copy source code
COPY src/ src/

# HTTP transport: listen on all interfaces, port 8000
ENV CRUSTDATA_HTTP_HOST=0.0.0.0
ENV CRUSTDATA_HTTP_PORT=8000
ENV CRUSTDATA_HTTP_PATH=/mcp

EXPOSE 8000

CMD ["uv", "run", "crustdata-mcp-http"]
