feat: initial La Gaufre v2 integration service

Multi-stage Docker image that:
- Builds lagaufre.js v2 widget from suitenumerique/integration source
  (context must be sunbeam/ root; see sunbeam build integration)
- Serves the widget, official La Suite SVG logos, custom logos for
  drive/mail/people, and a v1-compat gaufre.js wrapper via nginx

gaufre.js reveals the ui-kit GaufreButton (adds lasuite--gaufre-loaded
to <html>), loads the v2 widget, and wires button clicks via event
delegation to survive React hydration replacing the initial DOM element.

services.json is the only runtime-variable file; it is mounted from the
integration-config ConfigMap which contains the deployed service list
with DOMAIN_SUFFIX substituted at apply time.
This commit is contained in:
2026-03-03 16:09:21 +00:00
commit 14a01dd5e7
7 changed files with 158 additions and 0 deletions

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
# ── Stage 1: build lagaufre.js from suitenumerique/integration source ──────────
# Build context must be the sunbeam/ root so we can reach both
# integration/packages/widgets/ and integration-service/.
FROM node:22-alpine AS widget-build
WORKDIR /src
COPY integration/packages/widgets/ .
RUN npm ci && npm run build
# ── Stage 2: nginx serving all static assets ────────────────────────────────────
FROM nginx:alpine
# Official La Suite service logos from the integration package source tree.
COPY integration/packages/integration/public/logos/ /usr/share/nginx/html/logos/
# Custom logos for O Estúdio services not in the official La Suite logo set
# (drive, mail, people — same two-tone #000091/#e1000f style as upstream).
COPY integration-service/logos/ /usr/share/nginx/html/logos/
# Built lagaufre.js v2 widget (11 kB, Shadow DOM, ARIA-compliant popup).
COPY --from=widget-build /src/dist/lagaufre.js /usr/share/nginx/html/widget/lagaufre.js
# v1-compat gaufre.js — thin wrapper loaded by people-frontend via sub_filter.
# Derives its origin from the script URL at runtime; no DOMAIN_SUFFIX baked in.
COPY integration-service/gaufre.js /usr/share/nginx/html/gaufre.js
# Nginx config — only services.json is mounted at runtime (from ConfigMap).
COPY integration-service/nginx.conf /etc/nginx/conf.d/default.conf