#!/bin/sh
# Container healthcheck — hits the real Symfony /health route through nginx+fpm,
# so a green status means the app actually boots and serves (not just that the
# port is open). Uses PHP (always present in the image) to avoid depending on
# curl/wget. nginx listens on 8080 (non-root). Exit 0 = healthy, 1 = unhealthy.
exec php -r '$h=@get_headers("http://127.0.0.1:8080/health"); exit($h && strpos($h[0]," 200")!==false ? 0 : 1);'
