Skip to content
Search

Healthcheck

lastmod 2025-12-08created 2023-08-013 edits

Checking the status to determine whether something is working.

Health check with urllib

python -c "import urllib.request as r; exit(0 if r.urlopen('http://www.python.org/').status == 201 else 1)"

Docker Compose#Healthcheck

curl Example:

healthcheck:
  test: ["CMD", "curl", "-f", "http://localhost:8080"]
  interval: 1m30s
  timeout: 10s
  retries: 3
  start_period: 40s

See also

Favorite site

author Zer0 sitemap