VeryGoodOpenSource / dart_frog

A fast, minimalistic backend framework for Dart 🎯
https://dartfrog.vgv.dev
MIT License
1.87k stars 150 forks source link

Standalone deployment #1357

Open okoumea opened 6 months ago

okoumea commented 6 months ago

I just discovered dart_frog and it's awesome.

I'm new to using Dart on the backend, i'm used to node.js, using a tool named PM2 i can launch and monitor the node backend process and it automatically "resurect" it in case of a crash.

My goal is to migrate to dart_frog to share common code between the flutter frontend dans the backend, but i would like to keep the same deployment workflow.

So far i've seen that i can produce a binary with dart_frog build && dart compile exe bin/server.dart and execute it to start the server. But i don't know how i can easily monitor the process and make it restart in case of a crash (can i use the Deamon for that ?).

I think it would be nice to have some documentation about how to deploy and manage a dart_frog API without Docker.

alestiago commented 6 months ago

Hi @okoumea thanks for opening an issue and giving feedback on the tool 💙 !

I think it would be nice to have some documentation about how to deploy and manage a dart_frog API without Docker.

I do agree, personally I haven't tried doing so. Hence, it would require some investigation on my end to figure it out. If you get it working let us know and feel free to contribute with some documentation 🙌 !


Thoughts on this @wolfenrain @renancaraujo ?

wolfenrain commented 6 months ago

The compiled executable is just that, dart compiled to run as a single binary. So there is no daemon to attach to or process monitoring to listen for

You can always wrap any kind of implementation around that by defining your own init method!

We try to keep as agnostic as possible when it comes to this stuff