-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
134 lines (134 loc) · 3.49 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
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
services:
minio:
image: quay.io/minio/minio
container_name: minio
networks:
- net
ports:
- "9000:9000" # API
- "9001:9001" # Console
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
volumes:
- ./disk1:/disk1
command: server /disk1 --console-address ":9001"
restart: always
etcd-1: &etcd
image: zelvann/patroni-etcd-citus
networks:
- net
environment:
ETCD_LISTEN_PEER_URLS: http://0.0.0.0:2380
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
ETCD_INITIAL_CLUSTER: etcd-1=http://etcd-1:2380,etcd-2=http://etcd-2:2380,etcd-3=http://etcd-3:2380
ETCD_INITIAL_CLUSTER_STATE: new
ETCD_INITIAL_CLUSTER_TOKEN: tkn
container_name: etcd-1
hostname: etcd-1
command: etcd --name etcd-1 --initial-advertise-peer-urls http://etcd-1:2380
etcd-2:
<<: *etcd
container_name: etcd-2
hostname: etcd-2
command: etcd --name etcd-2 --initial-advertise-peer-urls http://etcd-2:2380
etcd-3:
<<: *etcd
container_name: etcd-3
hostname: etcd-3
command: etcd --name etcd-3 --initial-advertise-peer-urls http://etcd-3:2380
haproxy:
image: zelvann/patroni-etcd-citus
networks:
- net
env_file: patroni.env
hostname: haproxy
container_name: haproxy
ports:
- 5000:5000 # Access to coordinator primary
- 5001:5001 # LB
command: haproxy
environment: &haproxy_env
ETCDCTL_ENDPOINTS: http://etcd-1:2379,http://etcd-2:2379,http://etcd-3:2379
PATRONI_ETCD3_HOSTS: "'etcd-1:2379','etcd-2:2379','etcd-3:2379'"
PATRONI_CITUS_GROUP: 0
PGSSLMODE: verify-ca
PGSSLKEY: /etc/ssl/private/ssl-cert-snakeoil.key
PGSSLCERT: /etc/ssl/certs/ssl-cert-snakeoil.pem
PGSSLROOTCERT: /etc/ssl/certs/ssl-cert-snakeoil.pem
coord-1:
image: zelvann/patroni-etcd-citus
networks:
- net
env_file: patroni.env
container_name: coord-1
hostname: coord-1
environment: &coord_env
<<: *haproxy_env
PATRONI_NAME: coord-1
PATRONI_CITUS_GROUP: 0
coord-2:
image: zelvann/patroni-etcd-citus
networks:
- net
env_file: patroni.env
container_name: coord-2
hostname: coord-2
environment:
<<: *coord_env
PATRONI_NAME: coord-2
coord-3:
image: zelvann/patroni-etcd-citus
networks:
- net
env_file: patroni.env
container_name: coord-3
hostname: coord-3
environment:
<<: *coord_env
PATRONI_NAME: coord-3
worker1-1:
image: zelvann/patroni-etcd-citus
networks:
- net
env_file: patroni.env
container_name: worker1-1
hostname: worker1-1
environment: &work1_env
<<: *haproxy_env
PATRONI_NAME: worker1-1
PATRONI_CITUS_GROUP: 1
worker1-2:
image: zelvann/patroni-etcd-citus
networks:
- net
env_file: patroni.env
container_name: worker1-2
hostname: worker1-2
environment:
<<: *work1_env
PATRONI_NAME: worker1-2
worker2-1:
image: zelvann/patroni-etcd-citus
networks:
- net
env_file: patroni.env
container_name: worker2-1
hostname: worker2-1
environment: &work2_env
<<: *haproxy_env
PATRONI_NAME: worker2-1
PATRONI_CITUS_GROUP: 2
worker2-2:
image: zelvann/patroni-etcd-citus
networks:
- net
env_file: patroni.env
container_name: worker2-2
hostname: worker2-2
environment:
<<: *work2_env
PATRONI_NAME: worker2-2
networks:
net:
driver: bridge