-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsupavisor.yml
More file actions
75 lines (69 loc) · 2.19 KB
/
Copy pathsupavisor.yml
File metadata and controls
75 lines (69 loc) · 2.19 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
supavisor:
pidfile: /tmp/supavisor.pid
socket: /tmp/supavisor.sock
log_level: debug # Options: debug, info (default), warn, error
# logfile: /tmp/supavisor.log
# log_format: text # Options: text (default), json
programs:
process1:
command: /bin/sleep 5
autostart: true
autorestart: always
stdout_logfile: /tmp/process1.log
stderr_logfile: /tmp/process1.log
process2:
command: /bin/sleep 1d
autostart: true
autorestart: never
depends_on:
- process1
stdout_logfile: /tmp/process2.log
stderr_logfile: /tmp/process2.log
process3:
command: /bin/sleep 15
autostart: true
autorestart: always
stdout_logfile: /tmp/process3.log
stderr_logfile: /tmp/process3.log
# Stands in for a database: its process is up at once, but it cannot serve
# until it has finished bootstrapping ten seconds later. The marker file is
# what a real one would answer pg_isready with.
db:
command: /bin/sh -c 'rm -f /tmp/db.ready; sleep 10; touch /tmp/db.ready; sleep 1d'
autostart: true
autorestart: always
health_check:
exec: /bin/sh -c 'test -f /tmp/db.ready'
# Or, for a real database:
# exec: pg_isready -q -h 127.0.0.1
# tcp: 127.0.0.1:5432
# http: http://127.0.0.1:8080/readyz
interval: 1s
timeout: 2s
retries: 3
# Covers the bootstrap, so the wait reads as STARTING rather than
# UNHEALTHY while the database is still coming up
start_period: 15s
stdout_logfile: /tmp/db.log
stderr_logfile: /tmp/db.log
# Waits for the check to pass, not merely for the process. `sctl status` shows
# it STOPPED while db is RUNNING but STARTING, then RUNNING once db is HEALTHY.
api:
command: /bin/sleep 1d
autostart: true
autorestart: never
depends_on:
db:
condition: healthy
stdout_logfile: /tmp/api.log
stderr_logfile: /tmp/api.log
# The list form is unchanged: this one only needs the process to be up, so it
# starts about ten seconds before api does.
db-logs:
command: /bin/sleep 1d
autostart: true
autorestart: never
depends_on:
- db
stdout_logfile: /tmp/db-logs.log
stderr_logfile: /tmp/db-logs.log