How to know the reason why a docker container exits?
Others have mentioned docker logs $container_id to view the output of the application. This would always be my first thing to check.
Next, you can run a docker inspect $container_id to view details on the state.