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
daiOP7mo ago
but miniflare@3 no longer includes a CLI.
Erisa
Erisa7mo ago
I'd setup workerd directly, it's going to be more complex but would result in a more stable solution
Erisa
Erisa7mo ago
GitHub
GitHub - cloudflare/workerd: The JavaScript / Wasm runtime that pow...
The JavaScript / Wasm runtime that powers Cloudflare Workers - cloudflare/workerd
dai
daiOP7mo ago
Thank you very much for your help! How does Wokerd load environment configurations, such as the [[d1_databases]] for the d1 database?
Mackenly
Mackenly7mo 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
ggu6mo 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
daiOP6mo 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
ggu6mo ago
Hmm, what’s wrong with using miniflare/wrangler then?
dai
daiOP6mo 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
ggu6mo ago
Can you use npx wrangler dev?
Want results from more Discord servers?
Add your server