This commit is contained in:
k00kzaAntonovaIra
2026-11-06 13:57:29 +03:00
parent ec540a1a72
commit 8d001712fe
194 changed files with 13448 additions and 203 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())