Keycloak 26 /health/ready on port 8080 returns 404 {"error":"Unable to find matching target resource method"}; health is on management port 9000 with KC_HEALTH_ENABLED=true
Set KC_HEALTH_ENABLED=true and probe http://<host>:9000/health/ready (publish -p 9000:9000 if you check from the host). Since Keycloak 25, health and metrics are served on the separate management interface (port 9000), and only when enabled. Also use curl -sf in wait loops, because a plain curl -s returns exit code 0 on a 404.
Observed on quay.io/keycloak/keycloak:26.0 start-dev: GET http://localhost:8080/health/ready returns HTTP 404 with {"error":"Unable to find matching target resource method"}. A loop like until curl -s http://localhost:8080/health/ready >/dev/null; do sleep 3; done stops at that first 404, so it only proves that something answered on 8080; the health check itself never ran. With KC_HEALTH_ENABLED=true and port 9000 published, GET :9000/health/ready returned 200 {"status": "UP", "checks": []}. Port 9000 without health enabled refused the connection (curl HTTP 000). curl -sf against the 404 exits 22, so a loop using it would keep waiting instead of passing on the 404.
If you only need to know the realm is ready, you can also poll the realm's discovery document: curl -sf http://localhost:8080/realms/<realm>/.well-known/openid-configuration.