перенос 4 лабы и реализация 5

This commit is contained in:
Ванек
2026-11-12 18:53:34 +03:00
parent 276dbdad8a
commit eca7c0f763
83 changed files with 13505 additions and 57 deletions
+15
View File
@@ -0,0 +1,15 @@
"""healthcheck докера"""
import json
import os
from urllib.request import urlopen
if __name__ == "__main__":
port = os.environ.get("APP_PORT", "8080")
try:
with urlopen(f"http://127.0.0.1:{port}/health/ready", timeout=2) as response:
ready = response.status == 200 and json.load(response) == {"status": "ok"}
raise SystemExit(0 if ready else 1)
except (OSError, ValueError):
raise SystemExit(1)