A minimal Worker whose Durable Objects start namespace-backed containers on demand.
- Node.js, pnpm, and Docker
- A Cloudflare account with Workers, Containers, and the new runtime enabled.
Install dependencies:
pnpm installAuthenticate, then deploy with the main preview build:
npx wrangler@4.131.0 whoami
npx wrangler@4.131.0 deployWrangler builds and pushes the image, prepares it to run on Cloudflare, uploads the Worker, and creates the namespace-backed application.
Use the Worker URL printed by Wrangler:
curl "https://<worker-url>/?instance=first"
curl "https://<worker-url>/_status?instance=first"
curl "https://<worker-url>/_destroy?instance=first"Each instance value selects a different Durable Object and container.
scheduling_policy: "durable_object"makes each Durable Object own its container lifecycle.- The named
images.appconfiguration tells Wrangler to build, push, and prepare the image. - Rollouts work alongside worker's gradual rollouts.