перенос основы проекта из 1 лабы

This commit is contained in:
Ванек
2026-10-22 13:44:26 +03:00
parent 65003b6119
commit 9961362555
24 changed files with 978 additions and 20 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)