ARG BASE_TAG=latest FROM arca-base:${BASE_TAG} AS builder COPY services/mcp-docugen ./services/mcp-docugen COPY themes ./themes RUN uv sync --frozen --no-dev --package mcp-docugen FROM python:3.11-slim AS runtime LABEL org.opencontainers.image.source="https://git.tielogic.xyz/Adriano/ArcaSuite" \ arca.service="mcp-docugen" WORKDIR /app COPY --from=builder /app /app ENV PATH="/app/.venv/bin:$PATH" # Chromium runtime libs + Playwright browser bundle for PDF rendering. RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates wget xdg-utils \ libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \ libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \ libgbm1 libasound2 libatspi2.0-0 libpangocairo-1.0-0 \ libpango-1.0-0 libcairo2 libgtk-3-0 fonts-liberation fonts-inter \ && rm -rf /var/lib/apt/lists/* ENV PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright RUN python -m playwright install chromium RUN useradd -m -u 1000 app && \ mkdir -p /data && chown app:app /data && \ chown -R app:app /opt/ms-playwright USER app VOLUME ["/data"] ENV HOST=0.0.0.0 PORT=9100 DATA_DIR=/data EXPOSE 9100 HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=15s \ CMD python -c "import httpx, os; httpx.get(f'http://localhost:{os.environ.get(\"PORT\",\"9100\")}/health').raise_for_status()" CMD ["mcp-docugen"]