Docker Compose healthcheck depends_on condition not working: why your container starts before Postgres is ready
Docker Compose healthcheck depends_on condition not working: why your container starts before Postgres is ready Your app container exits with ECONNREFUSED 127.0.0.1:5432 even though you wrote depends_on: postgres: condition: service_healthy, and the fix is almost always that the healthcheck is defined on the wrong service, or the Compose file is being read by a Compose…