-
Notifications
You must be signed in to change notification settings - Fork 17
/
docker-compose-example.yml
118 lines (111 loc) · 2.76 KB
/
docker-compose-example.yml
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
version: '2.2'
volumes:
ldb:
services:
# sidecar exposes the reader API over HTTP
sidecar:
build:
context: .
dockerfile: Dockerfile
ports:
- "1331"
restart: always
entrypoint:
- /usr/local/bin/ctlstore
- sidecar
volumes:
- ldb:/var/spool/ctlstore
# heartbeat sends a constant stream of mutations into the executive
heartbeat:
restart: always
build:
context: .
dockerfile: Dockerfile
entrypoint:
- /usr/local/bin/ctlstore
- heartbeat
- -executive-url
- executive:3000
- -heartbeat-interval
- 1s
- -family-name
- ctlstore
- -table-name
- heartbeats
- -writer-name
- heartbeat
- -writer-secret
- heartbeat
# supervisor periodically snapshots ldb
supervisor:
restart: always
build:
context: .
dockerfile: Dockerfile
entrypoint:
- /usr/local/bin/ctlstore
- supervisor
- -snapshot-url
- "file:///snapshots/snapshot.db"
- -snapshot-interval
- "60s"
- -reflector.ldb-path
- /data/supervisor-ldb.db
- -reflector.upstream-driver
- mysql
- -reflector.upstream-dsn
- ctldb:ctldbpw@tcp(mysql:3306)/ctldb?collation=utf8mb4_unicode_ci
volumes:
- ldb:/var/spool/ctlstore
# reflector pulls changes from mysql to a ldb
reflector:
restart: always
build:
context: .
dockerfile: Dockerfile
ports:
- 9090:9090
entrypoint:
- /usr/local/bin/ctlstore
- reflector
- -ldb-path
- /var/spool/ctlstore/ldb.db
- -changelog-path
- /var/spool/ctlstore/changelog
- -changelog-size
- "1000000"
- -upstream-driver
- mysql
- -upstream-dsn
- ctldb:ctldbpw@tcp(mysql:3306)/ctldb?collation=utf8mb4_unicode_ci
- -ledger-latency.disable # no ECS in a docker-compose environment
- -metrics-bind
- 0.0.0.0:9090
volumes:
- ldb:/var/spool/ctlstore
# executive guards the mysqldb
executive:
restart: always
build:
context: .
dockerfile: Dockerfile
entrypoint:
- /usr/local/bin/ctlstore
- executive
- -bind
- 0.0.0.0:3000
- -ctldb
- ctldb:ctldbpw@tcp(mysql:3306)/ctldb?collation=utf8mb4_unicode_ci
# mysql represents the upstream db
mysql:
build:
context: .
dockerfile: Dockerfile-mysql
restart:
always
environment:
MYSQL_ROOT_PASSWORD: ctldbpw
MYSQL_DATABASE: ctldb
MYSQL_USER: ctldb
MYSQL_PASSWORD: ctldbpw
mem_limit: 536870912