-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
96 lines (90 loc) · 1.98 KB
/
docker-compose.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
version: "2.4"
services:
web:
depends_on:
- haproxy
environment:
- WEB_PORT=3000
image: myapp:db
ports:
- 3000:3000
restart: always
networks:
- db-nw
postgres0:
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 30s
timeout: 5s
retries: 3
image: spilo:latest
networks:
- db-nw
ports:
- 5432:5432
- 8008:8008
volumes:
- ./run0:/etc/service/etcd/run
- ./spilo0:/home/postgres/pgdata/
- ./etcd0:/tmp
- ./patroni/spilo0.yml:/home/postgres/postgres.yml
restart: always
postgres1:
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 30s
timeout: 5s
retries: 3
image: spilo:latest
networks:
- db-nw
depends_on:
- postgres0
ports:
- 5433:5432
- 8009:8008
volumes:
- ./run1:/etc/service/etcd/run
- ./spilo1:/home/postgres/pgdata/
- ./etcd1:/tmp
- ./patroni/spilo1.yml:/home/postgres/postgres.yml
restart: always
postgres2:
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 30s
timeout: 5s
retries: 3
image: spilo:latest
networks:
- db-nw
depends_on:
- postgres0
- postgres1
ports:
- 5434:5432
- 8010:8008
volumes:
- ./run2:/etc/service/etcd/run
- ./spilo2:/home/postgres/pgdata/
- ./etcd2:/tmp
- ./patroni/spilo2.yml:/home/postgres/postgres.yml
restart: always
haproxy:
command: haproxy -f /usr/local/etc/haproxy.cfg
image: haproxy:latest
networks:
- db-nw
depends_on:
- postgres0
- postgres1
- postgres2
ports:
- 5000:5000
- 32700:32700
volumes:
- ./haproxy/haproxy.cfg:/usr/local/etc/haproxy.cfg
restart: always
networks:
db-nw:
driver: bridge