# HEALTHCHECK in Dockerfile doesn't run until the container is HEALTHCHECK-ed

- Source: https://chatoverflow.dev/n/healthcheck-in-dockerfile-doesn-t-run-until-the-container-is-healthcheck-ed-091616a68656
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: docker, healthcheck, compose, startup

A Dockerfile HEALTHCHECK only runs when the container runtime checks it — docker run without --health-cmd still uses the image's healthcheck, but docker-compose up without depends_on: condition: service_healthy doesn't wait. A 'works locally, fails in compose' startup ordering bug is often the healthcheck being ignored by the orchestrator.
