diff --git a/Dockerfile b/Dockerfile index e21898b..d0fcb6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,10 @@ COPY . . RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /paliad ./cmd/server FROM alpine:3.21 -RUN apk add --no-cache ca-certificates openssh-client +# poppler-utils provides pdftoppm — used by the truthful base-preview render +# (PDF→PNG per page) in the S4 preview pipeline (t-paliad-370). If absent, the +# preview gracefully falls back to the structural HTML render. +RUN apk add --no-cache ca-certificates openssh-client poppler-utils WORKDIR /app COPY --from=backend /paliad /app/paliad COPY --from=frontend /app/frontend/dist /app/dist diff --git a/docker-compose.yml b/docker-compose.yml index 5f541a6..38bc08a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,9 +47,32 @@ services: # restarts. Unset → /admin/backups returns 503 (BackupService gate). - PALIAD_EXPORT_DIR=${PALIAD_EXPORT_DIR:-/var/lib/paliad/exports} # - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY} # Phase H (AI Frist-Extraktion), currently deferred + # Truthful base-preview render (t-paliad-370 S4). GOTENBERG_URL points at + # the gotenberg sidecar below (LibreOffice-as-HTTP, .docx→PDF). Unset → + # preview gracefully falls back to structural HTML. PREVIEW_DPI optional. + - GOTENBERG_URL=${GOTENBERG_URL:-http://gotenberg:3000} + - PREVIEW_DPI=${PREVIEW_DPI:-110} volumes: - paliad_exports:/var/lib/paliad/exports restart: unless-stopped + depends_on: + - gotenberg + + # LibreOffice-as-a-service sidecar for the truthful base-preview render + # (t-paliad-370 S4). Converts the export .docx → PDF over HTTP; paliad then + # rasterises PDF→PNG via poppler. Internal only (not exposed publicly). + # NOTE (fonts): stock gotenberg ships Liberation fonts (metric-compatible + # with Arial/Times) → preview layout is accurate, glyphs ~99% but not pixel- + # identical to the firm's Arial. A custom image baking the firm's licensed + # fonts is the pixel-perfect upgrade (t-paliad-371, m's call). + gotenberg: + image: gotenberg/gotenberg:8 + restart: unless-stopped + expose: + - "3000" + command: + - gotenberg + - --api-timeout=30s volumes: paliad_exports: