#health-check Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
Bash Wait For Docker Container to Be Healthy
docker-compose entrypoints often need to wait for a sibling service (DB, cache) to be healthy before starting work. Poll the health-check status until healthy or timeout.
Bash Check If Port Is Open
Several ways to probe a remote port: nc (most portable), bash's /dev/tcp pseudo-device (zero deps), or curl. Pick by what's available.
Bash Wait For Service With Timeout
Block until a TCP port accepts connections, with a deadline. Used everywhere in docker-compose entrypoints — wait for the DB to be ready before running the app.
Bash Check URL Returns 200
Quick health-check helper: returns 0 if a URL responds with a 2xx status, non-zero otherwise. Use in pre-deploy smoke tests.
PHP Find Open TCP Port
Probe whether a remote host:port accepts connections, with a configurable timeout. Useful for quick health checks in deploy scripts.