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.
When a port is "already in use" — find the offending process and (carefully) kill it. `lsof` is the gold standard; `ss` is the lighter modern alternative.
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.
Reclaim disk space from Docker. `prune` operates on stopped containers, dangling images, build cache, and unused networks. Run periodically on CI runners.
Use `trap` to delete temp files / kill background workers when the script exits — even on Ctrl-C or an unhandled error. Single most-undervalued bash feature.
`docker compose logs -f` already does this — but the one-liner with --tail and filters is the more useful day-to-day workflow when you only care about recent activity from a subset of services.