Multi-Service Apps with wendy.json
When your project needs more than one container managed through a wendy.json file (rather than a docker-compose.yml), declare a services map in wendy.json. wendy run detects the ma
Multi-Service Apps with wendy.json
When your project needs more than one container managed through a wendy.json file (rather than a docker-compose.yml), declare a services map in wendy.json. wendy run detects the map and automatically orchestrates a parallel multi-service build and deployment.
wendy.json structure
{
"appId": "com.example.myapp",
"services": {
"db": {
"context": "db"
},
"api": {
"context": "api",
"dependsOn": ["db"],
"entitlements": [
{ "type": "network", "mode": "host" }
]
},
"frontend": {
"context": "frontend",
"dependsOn": ["api"]
}
}
}services map
Each key is a service name. Each value is a ServiceConfig object:
| Field | Type | Required | Description |
|---|---|---|---|
context | string | yes | Build context directory, relative to wendy.json. Must be a relative path and must not contain .. components. |
entitlements | array | no | Entitlements to apply to this service's container. Same schema as the top-level entitlements field. |
dependsOn | array of strings | no | Names of other services in this services map that must be created before this one. All referenced names must exist in the same map. |
Validation rules
wendy.json validation rejects the following:
- A service with an empty or missing
context. - A
contextthat is an absolute path. - A
contextthat contains..path components. - A
dependsOnentry that references a service name not present in theservicesmap. - A service
entitlementsentry with an unknown or missing type. - A service
persistentitlement missingnameorpath, or with a non-absolute or..-containingpath. - A service
networkentitlement with amodeother than"host"or"none". - A service
i2centitlement with a device not ini2c-Nformat. - A service
mcpentitlement with a port outside the range 1–65535. - More than one
mcpentitlement within a single service'sentitlementsarray.
ValidateJSON additionally warns on deprecated entitlement types and unknown entitlement keys within service-level entitlements arrays, using the same rules applied to the top-level entitlements field.
How wendy run handles multi-service projects
When appCfg.Services is non-empty, wendy run routes to the multi-service pipeline:
- Parallel build — all service images are built and pushed concurrently, with a maximum of 4 simultaneous builds. In interactive terminals a per-service spinner displays each service's status (
waiting→building…→built (Xs)/failed). In non-interactive terminals plain log lines are printed instead. - Ordered container creation — containers are created one at a time in topological dependency order. A service listed in another service's
dependsOnis created first. - Start and stream — all containers are started and their combined stdout/stderr is multiplexed to the terminal. Each line is prefixed with
[serviceName].
Press Ctrl-C to stop all services. The CLI cancels all streams, issues a StopContainer for each service concurrently, and waits up to 30 seconds before exiting.
Container naming
Each service container is named <appId>-<serviceName> (both lowercased). For example, with appId: "com.example.myapp" and service "api", the container name is com.example.myapp-api.
Filtering with --service
To build and run only a specific service (and its transitive dependencies):
wendy run --service apiThis resolves api and all services reachable through its dependsOn graph. Services outside this subset are not built or started. Passing an unknown service name returns an error immediately.
Flags
All standard wendy run flags apply. The following are particularly relevant for multi-service projects:
| Flag | Description |
|---|---|
--service <name> | Build and run only the named service and its transitive dependsOn dependencies. |
--deploy | Build and create all containers but do not start them. |
--detach | Start all containers but do not stream logs. |
Example layout
my-project/
wendy.json
db/
Dockerfile
api/
Dockerfile
frontend/
Dockerfilewendy run # builds and starts all three services
wendy run --service api # builds db and api only (frontend excluded)Limitations
- Log output is multiplexed with a
[serviceName]prefix on each line. Per-service log stream routing is not yet available. - Containers are created via individual
CreateContainercalls in dependency order. A groupedCreateAppGroupRPC for atomic creation is planned as a follow-up.
template.schema.json
template.schema.json is an optional file inside a Wendy project template that defines multi-phase, conditional configuration questions. Answers are collected interactively during w
wendy.json
wendy.json is the configuration file for a Wendy app. It lives at the root of your project and describes the app's identity, target platform, required capabilities, and runtime beh