From 3385b8397b36e0d228a4f20e3ffeb9003e70607f Mon Sep 17 00:00:00 2001 From: Pratik Narola Date: Sat, 23 May 2026 15:14:04 +0530 Subject: [PATCH] fix: give backend healthcheck a 90s start_period Backend startup needs ~30-60s (spaCy NLP models load, mem0 v2 init, MCP session manager, 4 workers). The Dockerfile's 5s start-period was too short, causing willfarrell/autoheal (running on the host with AUTOHEAL_CONTAINER_LABEL=all) to kill the container before it finished booting. Overriding the healthcheck in compose with a longer start_period keeps failures from counting until the app is actually ready. --- docker-compose.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 9a573fe..9b8c3a6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,6 +47,16 @@ services: depends_on: qdrant: condition: service_healthy + # Backend startup loads spaCy (NLP extra), initializes mem0 v2, mounts MCP, + # and warms 4 workers — needs ~30-60s. start_period below keeps healthcheck + # failures from counting (and from triggering willfarrell/autoheal) during + # boot. + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8000/health"] + interval: 30s + timeout: 10s + retries: 5 + start_period: 90s restart: unless-stopped volumes: - ./backend:/app