Files
mesh-catalog/modules/redis/module.json
T
jochen 1b27ce319a redis: its handlers, tools and provisioner run in the node's runtime (hq ADR 0198)
The mesh-redis container goes with its Dockerfile, build bases, bus credential and the state directory only that credential lived in. The bundle reaches redis on the port this machine published rather than the container network's name.
2026-10-03 23:33:50 +02:00

124 lines
2.4 KiB
JSON

{
"module": "redis",
"version": "1",
"provides": [
{
"name": "redis-cache",
"scope": "mesh"
}
],
"requires": [
"secret"
],
"capabilities": [
"container-runtime"
],
"emits": [
"cache.provisioned",
"cache.deprovisioned"
],
"consumes": [
"redis.cache.provisioned",
"redis.cache.deprovisioned"
],
"serves": {
"redis-cache": {
"port": 6379
}
},
"receives": {
"redis-cache": "${dir:grants}/mesh.json"
},
"grants": {
"redis-cache": "${dir:grants}"
},
"secrets": {
"secret": "${dir:state}/default.secret"
},
"listens": [
{
"name": "cache",
"port": 6379,
"protocol": "tcp",
"from": "mesh",
"why": "modules on any machine that were granted a cache"
}
],
"resources": [
{
"id": "state",
"type": "directory",
"mode": "0700",
"place": "."
},
{
"id": "grants",
"type": "directory",
"mode": "0700"
},
{
"id": "data",
"type": "directory",
"mode": "0700",
"owner": "999:1000"
},
{
"id": "server-conf",
"type": "file",
"path": "${dir:state}/redis.conf",
"mode": "0600",
"content": "requirepass ${secret:secret}\nappendonly yes\ndir /data\n",
"owner": "999:1000"
},
{
"id": "net",
"type": "network",
"name": "redis"
},
{
"id": "server",
"type": "container",
"name": "redis",
"image": "redis@sha256:520775a41a63e77e06c73e35d2fd9cc15921a609516818796b4ecbb813078bc7",
"network": "redis",
"ports": [
"6379"
],
"volumes": [
"${dir:data}:/data",
"${dir:state}/redis.conf:/etc/redis/redis.conf:ro"
],
"args": [
"/etc/redis/redis.conf"
],
"restart-on": [
"server-conf"
]
}
],
"build": {
"artifacts": [
{
"name": "code",
"kind": "bundle",
"language": "typescript",
"entrypoints": [
"index.js",
"tools/index.js",
"provisioner/index.js"
],
"loads": [
"index.js",
"tools/index.js",
"provisioner/index.js"
],
"env": {
"MESH_RECEIVES": "${dir:grants}/mesh.json",
"MESH_PROVISION_REDIS": "127.0.0.1:${port:6379}",
"MESH_PROVISION_PASSWORD_FILE": "${dir:state}/default.secret"
}
}
]
}
}