deploying to selfhosted workerd

Is there any way to run a worker project on a selfhosted workerd instance that's running in a container? So far I've only found wrangler's --experimental-local flag but that instead tries to spin up a new instance
6 Replies
kian
kian2y ago
Not with Wrangler, no
Up
UpOP2y ago
is there any alternative then? it doesn't specifically have to be wrangler
kian
kian2y ago
workerd would need to be reloaded with a new configuration - it should drain gracefully (meaning that inflight requests keep the old instance alive till finished) and you direct traffic at the new instance If you just want a more user-friendly abstraction over the capnproto configs, Miniflare 3 might give you some pointers as that takes the wrangler.toml and turns it into something that workerd is happy with
Up
UpOP2y ago
well that is half of what I want. 1) it's very annoying to have to assign a new port per worker, and then also set up routing rules for it- so I'll probably instead do 1 router worker that calls others 2) with plain JS files I can't import other libraries, like I would be able to with wrangler. (ex. https://hono.dev)
kian
kian2y ago
Wrangler is just calling esbuild under the hood so you could use that for your bundling - or use wrangler to do it by telling publish to just go to an outdir instead
Up
UpOP2y ago
by telling publish to just go to an outdir instead
oh it can do that? nice yeah that might work

Did you find this page helpful?