A proof branch, not for main: the route-forwarding bed reads this module's literal image and would break until the module is built. The modelling is right regardless — the image is upstream, so the mesh should mirror it once into its own registry and pin what that registry assigned, rather than every machine fetching a reference somebody else can move. Claude-Session: https://claude.ai/code/session_01D6qtiYU3P9jk3pnAXyAFyx
76 lines
1.6 KiB
JSON
76 lines
1.6 KiB
JSON
{
|
|
"module": "hello-web",
|
|
"slug": "hello",
|
|
"version": "1",
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"requires": [
|
|
"route"
|
|
],
|
|
"contributes": {
|
|
"route": {
|
|
"label": "hello",
|
|
"port": 8080
|
|
}
|
|
},
|
|
"binds": {
|
|
"route": "/var/lib/hello-web/route.json"
|
|
},
|
|
"listens": [
|
|
{
|
|
"port": 8080,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "the demo web page; only the route-proxy reaches it, and the public name is a route grant"
|
|
}
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"path": "/var/lib/hello-web",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "page",
|
|
"type": "file",
|
|
"path": "/var/lib/hello-web/index.html",
|
|
"mode": "0644",
|
|
"content": "hello from hello-web, routed by the mesh\n"
|
|
},
|
|
{
|
|
"id": "net",
|
|
"type": "network",
|
|
"name": "hello-web"
|
|
},
|
|
{
|
|
"id": "server",
|
|
"type": "container",
|
|
"name": "hello-web",
|
|
"network": "hello-web",
|
|
"ports": [
|
|
"8080:8080"
|
|
],
|
|
"volumes": [
|
|
"/var/lib/hello-web/index.html:/www/index.html:ro"
|
|
],
|
|
"args": [
|
|
"sh",
|
|
"-c",
|
|
"while true; do { printf 'HTTP/1.1 200 OK\\r\\nContent-Type: text/plain\\r\\nConnection: close\\r\\n\\r\\n'; cat /www/index.html; } | nc -l -p 8080; done"
|
|
],
|
|
"artifact": "server"
|
|
}
|
|
],
|
|
"build": {
|
|
"artifacts": [
|
|
{
|
|
"name": "server",
|
|
"kind": "upstream",
|
|
"from": "alpine@sha256:28bd5fe8b56d1bd048e5babf5b10710ebe0bae67db86916198a6eec434943f8b"
|
|
}
|
|
]
|
|
}
|
|
}
|