This commit is contained in:
k00kzaAntonovaIra
2026-11-02 20:05:33 +03:00
parent 0ab3a341aa
commit e3ff3b25ce
145 changed files with 9724 additions and 473 deletions
+20
View File
@@ -0,0 +1,20 @@
"""Проверка готовности для HEALTHCHECK контейнера."""
import os
import sys
import urllib.request
def main() -> int:
"""0, если /health/ready отвечает 200, иначе 1."""
port = os.environ.get("APP_PORT", "8080").strip() or "8080"
try:
url = "http://127.0.0.1:%s/health/ready" % port
with urllib.request.urlopen(url, timeout=2) as reply:
return 0 if reply.status == 200 else 1
except Exception:
return 1
if __name__ == "__main__":
sys.exit(main())