deploy/mainnet/chatmock: healthcheck via urllib (wget absent in image)

The storagetime/chatmock image has neither wget nor curl, so the
previous wget-based healthcheck always failed with "executable file
not found" and the container sat in "starting" forever. The image
does carry a Python interpreter (chatmock is a Flask app), so swap
to a 1-liner urllib probe of /health. /health returns 200 even
before OAuth login, so a red healthcheck now means the Flask server
itself is down.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
david
2026-05-19 13:58:06 +02:00
parent e4079fbdbd
commit e7a231cafd

View File

@@ -53,7 +53,10 @@ services:
volumes:
- chatmock_data:/data
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:8000/health >/dev/null || exit 1"]
# chatmock image has neither curl nor wget — use the bundled Python's
# urllib to probe /health. /health returns 200 even before OAuth login
# so an unhealthy state here means the Flask server itself is down.
test: ["CMD-SHELL", "python3 -c 'import urllib.request,sys; sys.exit(0 if urllib.request.urlopen(\"http://localhost:8000/health\", timeout=3).status==200 else 1)' || exit 1"]
interval: 20s
timeout: 5s
retries: 3