Give each settings-config runtime a mergeable config file with its own id (runtime-config) — the previous "config" collided with modules that already own a config directory, so ten runtimes mounted a config file no resource declared. Point each runtime's restart-on at it, so a settings change recreates the runtime and it re-reads the new value (needs the mesh-host container restart-on fix on issue/009-container-restart-on). Proven: runtime-restart-on-config e2e green. Claude-Session: https://claude.ai/code/session_01LrgweAeERJYBg88c5cKDzF
79 lines
1.8 KiB
JSON
79 lines
1.8 KiB
JSON
{
|
|
"module": "nodered",
|
|
"version": "1",
|
|
"emits": [
|
|
"module.nodered.flows.deployed"
|
|
],
|
|
"own-secrets": {
|
|
"broker": "/var/lib/mesh/nodered/broker"
|
|
},
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"listens": [
|
|
{
|
|
"port": 1880,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "the flow editor and the endpoints flows expose"
|
|
}
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "mesh-state",
|
|
"type": "directory",
|
|
"path": "/var/lib/mesh/nodered",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "data",
|
|
"type": "directory",
|
|
"path": "/services/nodered/data",
|
|
"mode": "0700",
|
|
"owner": "1000:1000"
|
|
},
|
|
{
|
|
"id": "server",
|
|
"type": "container",
|
|
"name": "nodered",
|
|
"image": "nodered/node-red@sha256:02a2b92a41b73d2bc388238b86e4fcaab7fb5466373adb24e1df6aa5845265ff",
|
|
"env": {
|
|
"TZ": "Etc/UTC"
|
|
},
|
|
"ports": [
|
|
"1880"
|
|
],
|
|
"volumes": [
|
|
"/services/nodered/data:/data"
|
|
]
|
|
},
|
|
{
|
|
"id": "runtime-config",
|
|
"type": "file",
|
|
"path": "/var/lib/mesh/nodered/config.json",
|
|
"mode": "0600",
|
|
"content": "{}\n",
|
|
"merge": "json"
|
|
},
|
|
{
|
|
"id": "runtime",
|
|
"type": "container",
|
|
"name": "mesh-nodered",
|
|
"image": "mesh-runtime-nodered@sha256:0000000000000000000000000000000000000000000000000000000000000000",
|
|
"network": "host",
|
|
"volumes": [
|
|
"/var/lib/mesh/nodered/broker:/run/secrets/broker:ro",
|
|
"/var/lib/mesh/nodered/config.json:/run/config/config.json:ro"
|
|
],
|
|
"env": {
|
|
"MESH_BROKER_FILE": "/run/secrets/broker",
|
|
"MESH_NODERED_URL": "http://127.0.0.1:1880",
|
|
"MESH_NODERED_CONFIG_FILE": "/run/config/config.json"
|
|
},
|
|
"restart-on": [
|
|
"runtime-config"
|
|
]
|
|
}
|
|
]
|
|
}
|