Skip to content

Installation Profiles & Compose Stacks ​

LatticeDX (0.4.2) organizes container infrastructure under infra/compose/*.yml into composable stacks for local development, isolated upgrade rehearsals, and Zero-Trust production deployments. Every image reference is pinned to an immutable @sha256 digest and enforces security_opt: [no-new-privileges:true].

Compose Files Inventory ​

FileProject nameIncluded ServicesPrimary Purpose
infra/compose/core.ymllattice-dxpostgres, keycloak, api, gateway, clamavLocal Fastify companion API, Keycloak OIDC dev realm, and Apache APISIX bound to 127.0.0.1:8080.
infra/compose/nocobase.ymllattice-dxnocobase-db, redis, nocobasenocobase/nocobase:2.2.50 host mounting 7 plugins :ro, pgvector 0.8.1, and Valkey 8.1 on 127.0.0.1:13000.
infra/compose/iiot.ymllattice-dxmosquitto, noderedIsolated IIoT edge stack on iiot-net (Eclipse Mosquitto 2.0.21 DynSec + Node-RED 4.0.9).
infra/compose/integration.ymllattice-dxorion-mongo, orion-ld, n8nNGSI-LD Context Broker (FIWARE Orion-LD 1.12.0) and n8n 2.48.1 workflow runtime.
infra/compose/native-files.yml(overlay)Env overlay for api and nocobaseEnables api:4000 + clamav attachment scanning when combining core.yml and nocobase.yml.
infra/compose/native-rehearsal.ymllattice-native-rehearsalnocobase-db, nocobaseIsolated upgrade rehearsal and pnpm native:clean lab bound to 127.0.0.1:13001 (or 13004..13999).
infra/compose/uc1-sample.yml(overlay)uc1-sample, uc1-broker-workerExternal application bridge sample service on 127.0.0.1:4100.
infra/compose/prod.ymllattice-dx-prod12 default services + 8 profiled servicesHardened Zero-Trust production stack with Caddy 2.10, RustFS 1.0.6, PITR WAL archiving, and cap_drop: [ALL].

Production Profiles (infra/compose/prod.yml) ​

The production stack launches 12 core services by default and gates optional workloads behind 5 opt-in Compose profiles:

Opt-In Profiles in infra/compose/prod.yml
ParameterTypeDefaultDescription
iam-sync
oneshotkeycloak-config-cliImports and reconciles the production Keycloak realm (lattice-realm.prod.json) and exits cleanly (restart: no).
n8n
servicen8n (2.48.1)Runs n8n backed by the dedicated n8n_app PostgreSQL 16 role and exposed via Caddy N8N_DOMAIN.
observability
3 servicesotel-collector, prometheus, grafanaCollects OTLP traces (:4317/:4318), runs Prometheus v3.3.0 (15d retention), and serves Grafana 11.5.8 dashboards.
pdf
servicegotenberg (8.20.1)Renders Unicode HTML-to-PDF vouchers on a read-only filesystem with --chromium-disable-javascript=true.
iiot
2 servicesmosquitto, noderedStarts the Dynamic-Security MQTT broker on iiot-net alongside Node-RED with AES-256-CTR encrypted credentials.
bash
docker compose --env-file .env.prod -f infra/compose/prod.yml up -d

Default and Profiled Service Breakdown (prod.yml) ​

The table below lists the digest-pinned image tags, memory/CPU limits, network attachments, and healthcheck mechanisms for all 20 service definitions in infra/compose/prod.yml:

ServiceProfileImage TagRAM / CPUNetworksHealthcheck Mechanism
caddy(default)caddy:2.10-alpine256m / 0.5edge, apphttp://127.0.0.1:2019/metrics
postgres(default)postgres:16.16-alpine1536m / 1.5datapg_isready -U "$POSTGRES_USER" -d postgres
nocobase-db(default)pgvector/pgvector:0.8.1-pg162048m / 2.0datapg_isready -U "$POSTGRES_USER" -d nocobase
redis(default)valkey/valkey:8.1-alpine640m / 0.5app, datavalkey-cli ping | grep -q PONG
rustfs(default)rustfs/rustfs:1.0.61024m / 1.0dataTCP 127.0.0.1:9000
keycloak(default)quay.io/keycloak/keycloak:26.8.21536m / 1.5edge, app, data/health/ready on port 9000
clamav(default)clamav/clamav:1.5.52048m / 1.0scannerclamdcheck.sh
file-scanner(default)apps/file-scanner/Dockerfile256m / 0.5app, data, scannerhttp://127.0.0.1:4010/health
gateway(default)apache/apisix:3.19.0-debian512m / 1.0edge, apphttp://127.0.0.1:9080/health
orion-mongo(default)mongo:8.01024m / 1.0datamongosh SCRAM-authenticated ping
orion-ld(default)fiware/orion-ld:1.12.0768m / 1.0app, datahttp://127.0.0.1:1026/version
nocobase(default)nocobase/nocobase:2.2.502048m / 2.0edge, app, data, iiot-nethttp://127.0.0.1/api/app:getLang
keycloak-config-cliiam-syncadorsys/keycloak-config-cli:6.5.1-26512mappOneshot task (restart: "no")
n8nn8nn8nio/n8n:2.48.11024m / 1.0app, datahttp://127.0.0.1:5678/healthz
otel-collectorobservabilityotel/opentelemetry-collector-contrib:0.123.0512m / 0.5app, data/otelcol-contrib validate
prometheusobservabilityprom/prometheus:v3.3.0512m / 0.5app, datahttp://127.0.0.1:9090/-/healthy
grafanaobservabilitygrafana/grafana-oss:11.5.8512m / 0.5app, datahttp://127.0.0.1:3000/api/health
gotenbergpdfgotenberg/gotenberg:8.20.1768m / 1.0apphttp://127.0.0.1:3000/health
mosquittoiioteclipse-mosquitto:2.0.21256m / 0.5iiot-netnc -z 127.0.0.1 1883
noderediiotnodered/node-red:4.0.9512m / 0.5iiot-net, apphttp://127.0.0.1:1880/

Five Segmented Production Networks ​

infra/compose/prod.yml defines 5 bridge networks. Four of them specify internal: true so databases, caches, virus scanners, and MQTT brokers have zero direct egress or ingress outside controlled gateway paths:

NetworkIsolation ModeAttached ServicesSecurity Boundary
edgeExternal bridgecaddy, keycloak, gateway, nocobaseTerminates TLS on ports 80/443 at Caddy and forwards traffic to APISIX, Keycloak, or NocoBase.
appinternal: truecaddy, redis, keycloak, keycloak-config-cli, file-scanner, gateway, orion-ld, nocobase, n8n, otel-collector, prometheus, grafana, gotenberg, noderedCarries internal HTTP/OTLP traffic between gateways, host runtime, scanner, Orion-LD, and telemetry services.
datainternal: truepostgres, nocobase-db, redis, rustfs, keycloak, file-scanner, orion-mongo, orion-ld, nocobase, n8n, otel-collector, prometheus, grafanaIsolates PostgreSQL 16, Valkey 8.1, RustFS S3, and MongoDB 8.0 from the edge network.
scannerinternal: trueclamav, file-scannerRestricts clamd (:3310) access exclusively to @dx/file-scanner.
iiot-netinternal: truenocobase, mosquitto, noderedIsolates MQTT :1883 inside the edge telemetry bridge without exposing host ports.

Resource Limits & Hardware Sizing ​

Sizing allocations below aggregate the explicit mem_limit and cpus constraints defined across infra/compose/*.yml:

Deployment TierCompose / Script ScopeSum of Container LimitsRecommended Host Sizing (CPU / RAM / Disk)
Isolated Clean Labnative-rehearsal.yml (nocobase-db + nocobase)2.0 GB RAM2–4 vCPU, 4–8 GB RAM, 10 GB free
Local Development Corecore.yml + nocobase.yml6.66 GB RAM4–6 vCPU, 12–16 GB RAM, 25 GB SSD
Local Dev + Integration & IIoTcore.yml + nocobase.yml + integration.yml + iiot.yml9.22 GB RAM6–8 vCPU, 16 GB RAM, 35 GB SSD
Production Core (Default)prod.yml (12 default services)13.4 GB RAM / 12.5+ CPU8–16 vCPU, 16–24 GB RAM, 60+ GB NVMe
Production Full Suite (All Profiles)prod.yml + n8n, observability, pdf, iiot17.3 GB RAM / 16+ CPU12–16+ vCPU, 24–32+ GB RAM, 100+ GB NVMe

Operational note for clamav/clamav:1.5.5: the antivirus daemon loads signature databases into memory at startup (start_period: 120s, mem_limit: 1536m in core.yml, 2048m in prod.yml). On workstations with less than 8 GB RAM allocated to Docker, use pnpm native:clean (native-rehearsal.yml) rather than booting core.yml and nocobase.yml concurrently.

Persistent Named Volumes (prod.yml) ​

SubsystemVolume NamesStored State
Edge Proxycaddy-data, caddy-configACME TLS certificates and Caddy runtime state.
Core PostgreSQL & PITRpostgres-data, postgres-wal-archivelattice, keycloak, n8n databases and .gz WAL segments (7-day default retention).
NocoBase DB & Storagenocobase-db-data, nocobase-wal-archive, nocobase-storagepgvector database, NocoBase WAL archives, and local application uploads.
Cache & Object Storeredis-data, rustfs-data, engine-objectsValkey 8.1 AOF persistence, RustFS S3 buckets, and temporary file-scanner objects.
Antivirus & Context Brokerclamav-signatures, orion-mongo-dataUpdated ClamAV definitions and Orion-LD MongoDB 8.0 entity store.
Profiled Extensionsn8n-data, prometheus-data, grafana-data, mosquitto-data, mosquitto-log, nodered-datan8n workflows/credentials, Prometheus TSDB (15d retention), Grafana state, Mosquitto DynSec DB, and Node-RED runtime data.

Port Matrix & Compose Validation ​

In local development stacks, only the ports listed below bind to 127.0.0.1 (postgres, nocobase-db, redis, clamav, orion-mongo, and mosquitto never publish host ports):

PortLocal Dev Bind (*.yml)Production Bind (prod.yml)Target Service
80, 443 (TCP/UDP)UnusedPublic on edgecaddy (routes LATTICE_DOMAIN, KEYCLOAK_DOMAIN, N8N_DOMAIN)
13000 / 13001127.0.0.1Internal :80 behind Caddy/APISIXnocobase (nocobase.yml / native-rehearsal.yml)
13004–13999127.0.0.1Unusednocobase spawned by pnpm native:clean
8080127.0.0.1Internal :9080 on edge/appgateway (Apache APISIX 3.19.0)
8081127.0.0.1Proxied via Caddy KEYCLOAK_DOMAINkeycloak (Keycloak 26.8.2)
1026127.0.0.1 (integration.yml)Internal :1026 on app/dataorion-ld (FIWARE Orion-LD 1.12.0)
5678127.0.0.1 (integration.yml)Proxied via Caddy N8N_DOMAIN (--profile n8n)n8n (n8n 2.48.1)
1880127.0.0.1 (iiot.yml)Internal :1880 (--profile iiot)nodered (Node-RED 4.0.9)
1883Internal iiot-netInternal iiot-net (--profile iiot)mosquitto (Eclipse Mosquitto 2.0.21)

Validate Compose syntax and inspect health statuses before maintenance or shutdown:

bash
docker compose --env-file .env.prod -f infra/compose/prod.yml \
  --profile n8n --profile observability --profile pdf --profile iiot config --quiet
  • Quickstart — Start an isolated lab with pnpm native:clean or the local dev stack with pnpm local:up.
  • Configuration — Full environment variable catalog across all profiles in prod.yml.
  • Production Deployment — Provisioning nocobase_app, rotating secrets, and enabling TLS termination.
  • Backup & PITR Recovery — Base backups, WAL archiving, and Point-in-Time Recovery procedures for PostgreSQL 16.

Apache-2.0 · LatticeDX v0.4.2 · Powered by NocoBase · v2.2.50 · Apache-2.0 (Clause 5.2)