Sometimes an app just needs a fresh process: a leaked connection, a stuck worker, a changed environment variable. The usual docker restart kills the container first and starts it second, so every request during the gap fails.
Part 3 of 7 in the Deploy and operate Levelrail series: 1. Install a Self-Hosted PaaS on Your Own Server in Five Minutes ; 2. Roll Back a Failed Docker Deploy Without Downtime ; 3. Restart a Docker Container Without Downtime (this post); 4. Node Graceful Shutdown in Docker: Handle SIGTERM on Deploy ; 5. Update the PHP Docker Image Security Patch, No Downtime ; 6. Docker Container Restarting in a Loop: 5 Causes, Fixed ; 7. Why a Failed Health Check Still Went Live .
In this guide we restart a demo app with levelrail-cli apps restart while a request loop hammers it, and we count what users would have seen. Every command and output below comes from a real run. We also found rough edges, and they get their own section near the end.
What you need
A running Levelrail instance.…