feat(mcp-docugen): scaffold service + Docker stack con gateway Caddy
Task 0 del piano (adattato a workspace uv): - services/mcp-docugen/: pyproject.toml, src/mcp_docugen/, tests/unit+integration/, README, .env.example. Package rinominato da docugen_mcp -> mcp_docugen. - Root pyproject.toml: aggiunto services/mcp-docugen a workspace members. - .python-version: 3.11 - uv.lock committato. Docker stack stile CerberoSuite/Cerbero con prefisso "arca-": - docker/base.Dockerfile -> arca-base:latest - docker/mcp-docugen.Dockerfile -> arca-mcp-docugen:dev (porta interna 9100, label arca.service, runtime multi-stage, user non-root, healthcheck) - docker-compose.yml root: gateway Caddy unica porta host (8080) + mcp-docugen su rete interna. Security defaults cap_drop ALL, no-new-privileges, read_only ove applicabile, restart unless-stopped. - gateway/Caddyfile: reverse proxy /mcp-docugen/* -> mcp-docugen:9100 + landing. - gateway/public/index.html: landing page minimale. .env.example root aggiornato con DOCUGEN_API_KEY + OPENROUTER_API_KEY condivisa. Task 1-12 (implementazione TDD effettiva) ancora da fare. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
FROM python:3.11-slim AS base
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip install --no-cache-dir "uv>=0.5,<0.7"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pyproject.toml uv.lock* ./
|
||||
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
@@ -0,0 +1,26 @@
|
||||
ARG BASE_TAG=latest
|
||||
|
||||
FROM arca-base:${BASE_TAG} AS builder
|
||||
COPY services/mcp-docugen ./services/mcp-docugen
|
||||
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"
|
||||
|
||||
RUN useradd -m -u 1000 app && \
|
||||
mkdir -p /data && chown app:app /data
|
||||
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"]
|
||||
Reference in New Issue
Block a user