FROM python:3.12-slim

WORKDIR /app

# Install system dependencies for keyring
RUN apt-get update && apt-get install -y --no-install-recommends \
    libsecret-1-0 \
    && rm -rf /var/lib/apt/lists/*

# Copy project files
COPY pyproject.toml README.md ./
COPY src/ src/
COPY scripts/ scripts/
COPY templates/ templates/

# Install with all extras
RUN pip install --no-cache-dir ".[all]"

# Create tmp directory for reports
RUN mkdir -p /app/tmp

EXPOSE 8080

# Default: run MCP server via stdio
CMD ["datarails-mcp", "serve"]
