Reliable Service Startup with Docker Compose Healthchecks
Using depends_on alone only waits for the container process to start, not for the database inside to accept connections. Adding a healthcheck block solves race conditions during stack deployment.