Nodejs Container Restart Policy

September 21, 2020  -   2 mins read time -   360 words -  garrardkitchen

nodejs, cluster, docker, docker-compose, resilience

If by accident to deploy a solution using the Node.js Cluster API and do not fork exited processes then the following docker-compose restart_policy will not help you: deploy: restart_policy: condition: on-failure If you’re using the Cluster API to schedule tasks across your processes, and all forked processes die, then the docker engine will just assume you’ve gracefully shutdown. Take this code for example, you will see that it doesn’t fork another process and therefore, at some point it will no longer process any anything: ...