How to launch rails app with react in SSR mode,. customizing fly.rake or fly.toml

Since bin/rails server normally won’t ever return, you won’t launch your node server.

There are a number of ways to launch multiple processes which are expected to run simultaneously. Foreman (and similar tools like overwind) are one way. See Running Multiple Processes Inside A Fly.io App for more options. Multi process machines are another.

Finally, since the Rakefile is ruby code, the following will also work:

fork { sh 'bin/rails server' }
fork { sh 'bin/vite my-node-server-script' }
Process.wait
1 Like