Status: Accepted (2026-11-28, O1). Extended by 0905 (LAN mode).
Hosting is cloud-agnostic (PLAN wave 3): every tier ships as a Docker image. The images must be small, run as non-root, have healthchecks, and carry only each tier’s runtime dependencies. uWebSockets.js ships glibc-only binaries for 5 platforms x 3 Node ABIs (90 MB). A local stack shaped like production is needed to try the product and to smoke-test images in CI.
One multi-target deploy/Dockerfile (targets api, realtime, docworker, mcp, web), built from the repo root. Its build context is filtered by deploy/Dockerfile.dockerignore.
manifests: package.json files and the lockfile only, so npm layers stay cached until dependencies change;deps: npm ci --ignore-scripts; only fsevents has an install script;build-server: deploy/build.mjs (ADR 0902);build-web: vite build, then gzip text assets for nginx gzip_static;prod-deps-<tier>: npm ci --omit=dev --workspace=@linorahq/<tier>, then drop .d.ts, .map, .md and the @linorahq links. realtime also keeps only uws_linux_<arch>_<abi>.node.gcr.io/distroless/nodejs26-debian13:nonroot. It’s glibc, which uWS needs, and has no shell or package manager. It runs as uid 65532 with NODE_ENV=production (SR-17).
/app holds dist plus that tier’s node_modules; /data/blobs is owned by nonroot for the local blob fallback.CMD ["--no-strip-types", "apps/<tier>/src/main.js"].deploy/healthcheck.mjs <tier> (node:http to the tier’s /healthz, 2 s timeout).--mode=compactor and is checked with healthcheck.mjs compactor.nginxinc/nginx-unprivileged (uid 101, :8080) serving the Vite build. Every header is set at server level from a template (SR-11):
default-src 'self'; script-src 'self'; style-src 'self'; connect-src ${LINORA_WEB_CONNECT_SRC}; frame-ancestors 'none'; ...;Referrer-Policy: no-referrer, Permissions-Policy, COOP, and HSTS (LINORA_WEB_HSTS);/assets/* for good (hashed names); index.html revalidates on every load.extra_ca, never baked into a layer.docker-compose.prod.yml (npm run prod:env once, then prod:up and prod:down):
s3-init, db-roles (deploy/postgres/roles.sql, SR-07), migrate (owner role, compiled migrate.js), realtime, api, docworker, compactor and compactor-large (ADR 0706, 0311), mcp, web, and an nginx edge (deploy/nginx/edge.conf)./v1/realtime to realtime, hashing on ?file; /v1/* to the api; /mcp to mcp; everything else to web..env.prod);read_only, cap_drop: ALL and no-new-privileges;internal is an internal: true network holding Postgres, S3, doc workers, the compactor and every metrics port, so the edge cannot reach them (SR-18);LINORA_TRUSTED_PROXIES trusts for X-Forwarded-For.mem_limit per tier is sized from the measured RSS. Logs rotate (json-file, 3 x 10 MB).node:26-alpine: uWS has no musl build.node:26-trixie-slim runtime: similar size, but adds a shell and npm to the attack surface.gzip_static covers precompression.deploy/smoke.mjs checks a running stack end to end (headers, auth, ops through realtime, doc-worker queries and render, snapshot, WebSocket via the edge, MCP), and CI runs it.