"""HEALTHCHECK do container: chama /health (liveness sem chave e sem dado; o estado fica no /v1/status).""" import os import sys import urllib.request try: url = f"http://127.0.0.1:{os.environ.get('PORT', '8000')}/health" with urllib.request.urlopen(url, timeout=5) as response: # noqa: S310 - localhost fixo sys.exit(0 if response.status == 200 else 1) except Exception: sys.exit(1)