Repository navigation
Expand file tree
/
Copy pathdocker-compose.healthchecks.yml
More file actions
88 lines (79 loc) · 2.76 KB
/
Copy pathdocker-compose.healthchecks.yml
File metadata and controls
88 lines (79 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Health checks that run at boot speed while a service starts, then once a minute.
#
# Laid over docker-compose.yml by `scripts/start.sh` and OpenBot Desktop, on an engine that runs a
# healthcheck's `start_interval`: Docker Engine 25 or newer (API 1.44). Run by hand, the same:
#
# docker compose -f docker-compose.yml -f docker-compose.healthchecks.yml up -d
#
# WHY. Every check below starts a process in its container, most of them an interpreter (Bun, Node,
# Python), and docker-compose.yml runs each every 5 or 10 seconds for as long as the service runs:
# tens of thousands of process starts a day on a laptop that is doing nothing. Once a service is
# up, nothing reads its health more often than that minute.
#
# WHY NOT IN docker-compose.yml ITSELF. Compose refuses a `start_interval` outright on an engine
# older than Docker Engine 25 ("can't set healthcheck.start_interval as feature require Docker
# Engine v25 or later", up to Compose 2.40 at least), and OpenBot runs on Docker Engine 20.10 and up.
# Podman takes the setting and ignores it, so there the first check would come a minute after the
# start and every start would wait that long. On either, the base file's cadence is the one that
# works, so it stays the base, and this is laid over it only where the engine runs it.
#
# HOW. During `start_period` the engine checks every `start_interval`, and the first pass ends the
# start: a service that is up in two seconds is healthy in two seconds, sooner than the base file's
# first check. After that, every `interval`. A start that takes longer than `start_period` is checked
# every minute from then on, so each is generous: the server applies its migrations before it
# answers.
services:
postgres:
healthcheck:
interval: 60s
start_period: 120s
start_interval: 1s
retries: 3
object-storage:
healthcheck:
interval: 60s
start_period: 120s
start_interval: 1s
retries: 3
server:
healthcheck:
interval: 60s
start_period: 600s
start_interval: 1s
retries: 3
agent-computer:
healthcheck:
interval: 60s
start_period: 180s
start_interval: 1s
retries: 3
supervisor:
healthcheck:
interval: 60s
start_period: 120s
start_interval: 1s
retries: 3
agent-claude-plan:
healthcheck:
interval: 60s
start_period: 180s
start_interval: 1s
retries: 3
agent-chatgpt-plan:
healthcheck:
interval: 60s
start_period: 180s
start_interval: 1s
retries: 3
agent-langgraph-agui:
healthcheck:
interval: 60s
start_period: 180s
start_interval: 1s
retries: 3
agent-langgraph-ts:
healthcheck:
interval: 60s
start_period: 180s
start_interval: 1s
retries: 3