-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
135 lines (124 loc) · 3.84 KB
/
docker-compose.yml
File metadata and controls
135 lines (124 loc) · 3.84 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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
version: "3.8"
networks:
default:
# Uncomment configs if you want to change the entrypoint or patroni config
configs:
haproxy.cfg:
file: haproxy.cfg
# patroni.yml:
# file: patroni.yml
# entrypoint.sh:
# file: entrypoint.sh
# Uncomment volumes if you want persistence
volumes:
dbdata:
driver: local
# dbdata1:
# driver: local
# dbdata2:
# driver: local
# dbdata3:
# driver: local
etcddata1:
driver: local
etcddata2:
driver: local
etcddata3:
driver: local
services:
etcd1:
image: 127.0.0.1:8889/bitnami/etcd:3.4.15
environment:
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_NAME=etcd1
- ETCD_INITIAL_ADVERTISE_PEER_URLS=http://etcd1:2380
- ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd1:2379
- ETCD_INITIAL_CLUSTER_TOKEN=etcd-cluster
- ETCD_INITIAL_CLUSTER=etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380
- ETCD_INITIAL_CLUSTER_STATE=new
volumes:
- type: volume
source: etcddata1
target: /bitnami/etcd/data
etcd2:
image: 127.0.0.1:8889/bitnami/etcd:3.4.15
environment:
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_NAME=etcd2
- ETCD_INITIAL_ADVERTISE_PEER_URLS=http://etcd2:2380
- ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd2:2379
- ETCD_INITIAL_CLUSTER_TOKEN=etcd-cluster
- ETCD_INITIAL_CLUSTER=etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380
- ETCD_INITIAL_CLUSTER_STATE=new
volumes:
- type: volume
source: etcddata2
target: /bitnami/etcd/data
etcd3:
image: 127.0.0.1:8889/bitnami/etcd:3.4.15
environment:
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_NAME=etcd3
- ETCD_INITIAL_ADVERTISE_PEER_URLS=http://etcd3:2380
- ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd3:2379
- ETCD_INITIAL_CLUSTER_TOKEN=etcd-cluster
- ETCD_INITIAL_CLUSTER=etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380
- ETCD_INITIAL_CLUSTER_STATE=new
volumes:
- type: volume
source: etcddata3
target: /bitnami/etcd/data
haproxy:
image: haproxy:2.2.14-alpine
configs:
- source: haproxy.cfg
target: /usr/local/etc/haproxy/haproxy.cfg
ports:
- "5002:5000" # Postgres
- "7001:7000" # HAProxy stats
db1:
image: 127.0.0.1:8889/spgcontrols/patroni-postgres:2.0.2-13.3
hostname: db1 # used for patroni name
environment:
- PATRONI_ETCD3_HOSTS='etcd1:2379','etcd2:2379','etcd3:2379'
- PATRONI_admin_PASSWORD=SpgControls01!@
- PATRONI_admin_OPTIONS=createrole,createdb
#configs: &configs
# - source: patroni.yml
# target: /app/patroni.yml
# - source: entrypoint.sh
# target: /app/entrypoint.sh
volumes:
- type: volume
source: dbdata
target: /app/postgresql
db2:
image: 127.0.0.1:8889/spgcontrols/patroni-postgres:2.0.2-13.3
hostname: db2 # used for patroni name
environment:
- PATRONI_ETCD3_HOSTS='etcd1:2379','etcd2:2379','etcd3:2379'
- PATRONI_admin_PASSWORD=SpgControls01!@
- PATRONI_admin_OPTIONS=createrole,createdb
#configs: *configs
volumes:
- type: volume
source: dbdata
target: /app/postgresql
db3:
image: 127.0.0.1:8889/spgcontrols/patroni-postgres:2.0.2-13.3
hostname: db3 # used for patroni name
environment:
- PATRONI_ETCD3_HOSTS='etcd1:2379','etcd2:2379','etcd3:2379'
- PATRONI_admin_PASSWORD=SpgControls01!@
- PATRONI_admin_OPTIONS=createrole,createdb
#configs: *configs
volumes:
- type: volume
source: dbdata
target: /app/postgresql