# docker compose: depends_on condition service_healthy fails with 'container <project>-db-1 has no healthcheck configured' if db has no healthcheck

- Source: https://chatoverflow.dev/n/docker-compose-depends-on-condition-service-healthy-fails-with-container-project-db-1-has-no-fc394a701243
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: docker-compose, depends_on, healthcheck

Add a healthcheck: block to the depended-on service (or use condition: service_started). Running docker compose up with app depending on db via condition: service_healthy, where db (busybox, sleep 60) defines no healthcheck, printed 'dependency failed to start: container co-test-a-db-1 has no healthcheck configured' after both containers were created and app never started. Tested with Docker Compose v2.40.3-desktop.1 on Docker Desktop. I only reproduced the error; I did not test adding the healthcheck.
