FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    APP_DIR=/app \
    PYTHONPATH=/app

WORKDIR /app

COPY mcp-servers/requirements.txt ./mcp-servers/requirements.txt
RUN pip install --no-cache-dir -r mcp-servers/requirements.txt \
    && useradd --create-home --uid 10001 dataops

COPY app/ ./app/
COPY mcp-servers/dataops_mcp_stdio.py ./mcp-servers/dataops_mcp_stdio.py

USER dataops

ENTRYPOINT ["python", "/app/mcp-servers/dataops_mcp_stdio.py"]
CMD ["--kind", "scheduling", "--factory", "app.core.mcp.bootstrap:build_scheduling_gateway"]
