Skip to content

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Stratum-Node · Enterprise Workload Architecture

(Node.js 22 LTS · Express / Fastify / NestJS / Next.js Standalone)

«Aislamiento por diseño, no por disciplina» — (“Isolation by design, not by discipline”)

Stratum es una arquitectura de referencia y un conjunto de herramientas para operar organizaciones o aplicaciones aisladas sobre una infraestructura compartida, con aislamiento mediante namespaces de red del kernel Linux y firewall DOCKER-USER. Está diseñada para reducir la dependencia de la disciplina operativa, y no constituye garantía de resultado.

📖 Manual de Operación y Despliegue Paso a Paso · 📜 Third-Party Notices (Valkey / PostgreSQL / Licenses)

Platform Architect & Designer Umbrella Organization Node Cache Security License

Product Suite: Stratum Sovereign Multi-Tenant Architecture
Repository: stratum-node (node-stratum)
Component: consumer-workload
Pattern: Stratum Sovereign Consumer (Tier 3)
Revision: 3.1.0
Status: Production


1. Overview

stratum-node provides a hardened, code-agnostic multi-stage container runtime (node:22-alpine) for Node.js 22 LTS APIs and web services (Express, Fastify, NestJS, Next.js standalone) engineered as a Tier 3 Consumer Workload within the Stratum Platform. Whether hosting a single organization or multiple organizations, deploy each organization as a stratum-org island.

Separation of Concerns: Your team places application code into src/. When no custom package.json is present, Stratum's built-in zero-dependency HTTP server (src/index.js) answers /, /health, /ready (including Valkey ACL AUTH/PING probe), and /up out of the box.

Key Architectural Invariants

  • Three Exclusive Deployment Modes (delegated, isolated, test): Every service in docker-compose.yml and docker-compose.outbound.yml declares an explicit profiles: list. Retired profiles (multi-org*, unique-org*, standalone, all) are removed.
  • Zero Public Ports (0.0.0.0 / :: Prohibited, ADR-0007): Production modes (delegated, isolated) publish zero host ports. Only --profile test binds 127.0.0.1:${APP_LOCAL_PORT:-3000}:${APP_PORT:-3000} strictly on loopback.
  • Linux Kernel Network Namespace & DOCKER-USER Confinement: Workloads never join stratum_dmz, stratum_tunnel, or stratum_database_internal. Dedicated engines (postgres, valkey) live strictly inside app_internal (internal: true, enable_ipv6: false). Optional outbound egress via docker-compose.outbound.yml attaches only app-delegated or app-isolated to stratum_outbound (enable_icc=false, DOCKER-USER filtered).
  • Valkey 8.1 Prefix-Scoped ACLs (BSD-3-Clause, ADR-0005): Dedicated cache uses valkey/valkey:8.1-alpine as user: "999:1000", read_only: true, --aclfile /tmp/users.acl (0600) with user default off, user healthcheck -@all +ping, and prefix-scoped app user (CACHE_USER/CACHE_PREFIX).
  • Pinned Versioning (Zero :latest) & 1:1 .env.example Parity: All images (NODE_IMAGE_TAG=22-alpine, POSTGRES_VERSION=16-alpine, STRATUM_CACHE_VERSION=8.1-alpine) and Compose variables enforce 1:1 parity via stratum-core/tests/validate_specs.py.

2. Three Deployment Modes

Profile (--profile) App Service Database / Cache Routing Networks Attached
delegated app-delegated DB_HOST=stratum-database-nginx · CACHE_HOST=valkey (Org Valkey ACL) tenant_network (stratum_${TENANT_ORG}_internal)
isolated app-isolated DB_HOST=postgres:5432 · CACHE_HOST=valkey:6379 (private engines) tenant_network + app_internal (internal: true)
test app-test DB_HOST=postgres:5432 · CACHE_HOST=valkey:6379 (local dev/CI) app_internal + test_local (127.0.0.1:${APP_LOCAL_PORT}:3000)

Warning

Mandatory Queue Drain Notice (Redis → Valkey Migration):
Stratum operates its in-memory cache/queue broker without disk persistence (--save "" --appendonly no, ADR-0003 / ADR-0005). Before migrating an existing workload from legacy Redis to Valkey 8.1, drain all active queues cleanly. Compatibility aliases (redis, REDIS_HOST, REDIS_PORT, REDIS_USERNAME, REDIS_PASSWORD, REDIS_PREFIX) are preserved strictly as nominative references to the RESP2/RESP3 wire protocol (see THIRD-PARTY-NOTICES.md).


3. Quick Start

# 1. Configure 1:1 environment contract
cp .env.example .env && chmod 600 .env

# 2a. Delegated Mode (after stratum org create & stratum db create for postgres/valkey)
docker compose --profile delegated up -d --build
stratum route add acme node-api stratum-app-acme-node-delegated:3000 --domain api.acme.example.com

# 2b. Isolated Mode (dedicated Postgres 16 + Valkey 8.1 inside app_internal)
docker compose --profile isolated up -d --build

# 2c. Test Mode (local testing/CI — bound strictly to 127.0.0.1:3000)
docker compose --profile test up -d --build
curl -fsS http://127.0.0.1:3000/health

# Optional Internet Egress (delegated or isolated web service ONLY; never test mode)
docker compose -f docker-compose.yml -f docker-compose.outbound.yml --profile delegated up -d

4. Shared Responsibility & Legal Notice

  • Shared Responsibility: In delegated mode (stratum_${TENANT_ORG}_internal), sibling apps of the same organization share an internal bridge. Stratum enforces cross-organization network namespace isolation, DOCKER-USER kernel egress controls, per-app Valkey prefix ACLs, and container hardening; operators assume shared responsibility for intra-organization lateral risk by enforcing least-privilege per-service database roles (<org>_<service>) and using --profile isolated for high-risk workloads.
  • No Guarantee of Outcome (Obligación de medio, no de resultado): Provided "AS IS" under Apache-2.0. See THIRD-PARTY-NOTICES.md for upstream container licenses (including informational SSPL v1 review notes when connecting to shared MongoDB 8.0).

5. Architecture, Attribution & License

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages