Добавить X-Instance-Id, общую идемпотентность и строгий разбор тела запроса

This commit is contained in:
2026-10-30 21:43:16 +03:00
parent 0ab3a341aa
commit 91f1b3c06e
12 changed files with 895 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
"""Проверка для Docker HEALTHCHECK: код 0, если /health/ready отвечает 200."""
import os
import sys
import urllib.request
port = os.getenv("APP_PORT", "8080")
try:
with urllib.request.urlopen(f"http://127.0.0.1:{port}/health/ready", timeout=4) as response:
sys.exit(0 if response.status == 200 else 1)
except Exception:
sys.exit(1)