Provisioning
provision decides how a node comes to exist: from an image Alzo pulls or builds, by adopting something already running, or as a native process on this machine with an image for elsewhere. It never changes what the node is, which is what lets one definition serve several environments:
provision: dev
? { image: { context: '.', dockerfile: 'docker/db.Dockerfile' } }
: { adopt: { host: '127.0.0.1', port: { pg: 5432 } } },Adopting a running service
adopt skips build, start and teardown — and still runs the readiness probe, because a dependency someone else started is still one worth waiting for. The external system keeps its lifecycle: alzo down does not stop it. Adoption is also how several worktrees deliberately share one service, and how a Compose migration keeps a dependency outside Alzo.
Running natively, shipping as an image
There is a third form, and it is the answer to the macOS filesystem problem:
const api = defineService({
name: 'api',
ports: { http: { ingress: local } },
provision: {
image: { context: './services/api' }, // how it ships
local: { run: 'pnpm dev', cwd: './services/api' }, // how it runs here
},
});The same node, one identity, two ways to run. A host process remains the fastest answer for code that can run natively, because it reads your source directly instead of through Docker Desktop's file sharing.
alzo up api --containerize api takes the image branch for one run; repeat --containerize <node> to force more than one node, and pass the same flag to alzo plan to preview it. Follow-up commands read that choice from the running environment, so the flag does not need repeating. A name that is not a service or task with both provision.image and provision.local is refused before anything is allocated.
When the workload must run in a Linux container, a managed mirror (sync: true) gives the container a native copy of the source instead of a bind mount.