Deployment suggestion

Due to certain reasons, I am unable to deploy the worker on Cloudflare. Therefore, I have to deploy it on my own server. Currently, I am using wrangler dev for deployment, but it reloads the code and supports only single-threaded execution. To better deploy on my own server, I need a more optimized solution. Could you please provide some suggestions? Thank you!
10 Replies
dai
daiOP6mo ago
but miniflare@3 no longer includes a CLI.
Erisa
Erisa6mo ago
I'd setup workerd directly, it's going to be more complex but would result in a more stable solution
Erisa
Erisa6mo ago
GitHub
GitHub - cloudflare/workerd: The JavaScript / Wasm runtime that pow...
The JavaScript / Wasm runtime that powers Cloudflare Workers - cloudflare/workerd
dai
daiOP6mo ago
Thank you very much for your help! How does Wokerd load environment configurations, such as the [[d1_databases]] for the d1 database?
Mackenly
Mackenly6mo ago
If this is a long-term limitation, I would explore not tying yourself to worker technology. You're not going to get all of the benefits of using Workers if you self-host.
ggu
ggu5mo ago
workerd is also single threaded so you'd run into the same limitations. I also don't think running workerd raw would allow you access to a real live production d1 database. Any info on why you're unable to deploy on Cloudflare?
dai
daiOP5mo ago
@ggu 1. I don't mind that Workerd is single-threaded. 2. I only need Workerd to access local data, not a live production database. 3. Due to certain network restrictions, I am unable to use Cloudflare. Thank you very much for your response.
ggu
ggu5mo ago
Hmm, what’s wrong with using miniflare/wrangler then?
dai
daiOP5mo ago
@ggu miniflare has this problem
[mf:err] `miniflare@3` no longer includes a CLI. Please use `npx wrangler dev` instead.
As of `wrangler@3`, this will use Miniflare by default.
[mf:err] `miniflare@3` no longer includes a CLI. Please use `npx wrangler dev` instead.
As of `wrangler@3`, this will use Miniflare by default.
ggu
ggu5mo ago
Can you use npx wrangler dev?
Want results from more Discord servers?
Add your server