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 instance6 Replies
Not with Wrangler, no
is there any alternative then?
it doesn't specifically have to be wrangler
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
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)
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
by telling publish to just go to an outdir insteadoh it can do that? nice yeah that might work