title: How to stop docker container from starting if app initialization has failed?
body: <p>We have a flask service application which connects to a mysql database for data. This flask app is server via gunicorn in a docker container. We are using docker-compose for the same.</p>
  
  <p>When the application starts we make the connection to the database. If the connection to the database fails (3 attempts) the application fails to initialize and exits. But am noticing that the container starts. How can i cause the container to fail to start as well when my app fails to start?</p>