route-adapter: its step is a run-once process (hq ADR 0198)
The mesh-route-adapter container goes with its Dockerfile and build bases. The step runs node on the bundle as a run-once process, reading what the mesh contributed and its config where the mesh writes them and writing the proxy's dynamic directory at the path the container used to mount; it still runs again when a route or its config changes.
This commit is contained in:
@@ -47,23 +47,18 @@
|
||||
},
|
||||
{
|
||||
"id": "adapt",
|
||||
"type": "container",
|
||||
"name": "mesh-route-adapter",
|
||||
"artifact": "runtime",
|
||||
"run-once": true,
|
||||
"volumes": [
|
||||
"${dir:routes-dir}/mesh.json:${dir:routes-dir}/mesh.json:ro",
|
||||
"${dir:state}/config.json:/run/config/config.json:ro",
|
||||
"${access:dynamic}:/services/traefik/dynamic"
|
||||
"type": "process",
|
||||
"name": "route-adapter",
|
||||
"artifact": "code",
|
||||
"run": [
|
||||
"node",
|
||||
"index.js"
|
||||
],
|
||||
"run-once": true,
|
||||
"env": {
|
||||
"MESH_RECEIVES": "${dir:routes-dir}/mesh.json",
|
||||
"MESH_ROUTE_ADAPTER_CONFIG": "/run/config/config.json"
|
||||
"MESH_ROUTE_ADAPTER_CONFIG": "${dir:state}/config.json"
|
||||
},
|
||||
"args": [
|
||||
"run",
|
||||
"/app/modules/route-adapter/dist/index.js"
|
||||
],
|
||||
"restart-on": [
|
||||
"received-route",
|
||||
"config"
|
||||
@@ -71,23 +66,14 @@
|
||||
}
|
||||
],
|
||||
"build": {
|
||||
"on": [
|
||||
{
|
||||
"arg": "BUILD_BASE",
|
||||
"module": "mesh-tools",
|
||||
"artifact": "build"
|
||||
},
|
||||
{
|
||||
"arg": "RUNTIME_BASE",
|
||||
"module": "mesh-tools",
|
||||
"artifact": "runtime"
|
||||
}
|
||||
],
|
||||
"artifacts": [
|
||||
{
|
||||
"name": "runtime",
|
||||
"kind": "image",
|
||||
"from": "Dockerfile"
|
||||
"name": "code",
|
||||
"kind": "bundle",
|
||||
"language": "typescript",
|
||||
"entrypoints": [
|
||||
"index.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user