title: Dockerized Java Spring Boot application throws 504 Bad Gateway while its starting the application
body: <p>I have a java spring boot application deployed on a docker data center. Whenever we deploy stack for the service, as expected it kills existing containers and spins up new containers with new image. But the problem is we get 504 Bad Gateway while spring application starts inside the container which is typically 30-40 seconds. My hunch is since the container is up and running, load balancer sends requests to the container but the app is still starting, is there a way to get around this? It impacts because we have 5 containers for service and same thing happens for each containers. So good portion of users will get errors while this is happening.  </p>