{ "module": "mongodb", "version": "1", "provides": [ { "name": "mongodb-database", "scope": "mesh" } ], "capabilities": [ "container-runtime" ], "emits": [ "database.provisioned", "database.deprovisioned" ], "consumes": [ "mongodb.database.provisioned", "mongodb.database.deprovisioned" ], "listens": [ { "name": "database", "port": 27017, "protocol": "tcp", "from": "mesh", "why": "modules on any machine that were granted a database" } ], "serves": { "mongodb-database": { "port": 27017 } }, "receives": { "mongodb-database": "${dir:grants}/mesh.json" }, "grants": { "mongodb-database": "${dir:grants}" }, "own-secrets": { "root": "${dir:state}/root.secret" }, "resources": [ { "id": "state", "type": "directory", "mode": "0700", "place": "." }, { "id": "grants", "type": "directory", "mode": "0700" }, { "id": "data", "type": "directory", "mode": "0700" }, { "id": "net", "type": "network", "name": "mongodb" }, { "id": "server-root", "type": "file", "path": "${dir:state}/server-root.secret", "mode": "0400", "owner": "999:999", "content": "${secret:root}" }, { "id": "server", "type": "container", "name": "mongodb-server", "image": "mongo@sha256:e3fa459b4f4b72f3257c67a23c145e250b8b5700f033860392c68539b998bbe3", "network": "mongodb", "env": { "MONGO_INITDB_ROOT_USERNAME": "root", "MONGO_INITDB_ROOT_PASSWORD_FILE": "/run/secrets/root" }, "ports": [ "27017" ], "volumes": [ "${dir:data}:/data/db", "${dir:state}/server-root.secret:/run/secrets/root:ro" ] } ], "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_PROVISION_MONGODB": "mongodb://root@127.0.0.1:${port:27017}/admin?authSource=admin", "MESH_PROVISION_PASSWORD_FILE": "${dir:state}/root.secret", "MESH_RECEIVES": "${dir:grants}/mesh.json" } } ] } }