Background
I have a Spring Boot Application that I am deploying in a Docker container.
The application must be running 24/7. If it crashes, it must restart.
I have the option of configuring the container to restart on crash, and of using Kubernetes, but these are relatively slow operations.
I was under the impression that Tomcat, like IIS on Windows is able to restart applications that fail. Reloading an application within Tomcat should be quicker than reloading the entire container.
So, I tried deploying the application as an exploded war in Tomcat.
But it turns out, that all Tomcat does for me is to start the application and provide manual restart through its manager application.
I learned that Tomcat supports "reloading" if specified files are changed, but this is intended for development environments and it is recommended not to use it in production.
My Questions:
- Is it possible to configure my application under Tomcat so that if it crashes, Tomcat will restart it for me? How?
- If not, what advantages, if any, do I have when using Tomcat to host my application inside the container rather than simply running java -jar in the container?