Maintenance page while docker takes time to rebuilt

You rarely need to upgrade from the terminal. Use the Upgrade page (Admin → Upgrade) and there is virtually zero downtime.

For the rare occasions when you need to upgrade from the terminal, see @Moin 's link