How to have a zero-downtime deploy (Rails)

Hi, new here.
When I deploy my Rails app, there’s a few seconds of downtime where I get an error when I hit the app in the browser.
How can we avoid this?

I’m guessing that you have a volume?

If you don’t have a volume, fly deploy will start a new vm and only stop the previous vm after the new one passes a health check.

If you do have a volume, volumes can’t be shared between vms so the previous vm is stopped before the new vm is started.