A container can be ‘running’ but the app inside could be crashed or stuck in a loop. Use native Docker Healthchecks.
HEALTHCHECK --interval=30s --timeout=3s \ CMD curl -f http://localhost/health || exit 1
Now, docker ps will show (healthy) or (unhealthy) instead of just ‘Up’.
