-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
104 lines (99 loc) · 2.61 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
version: "3"
services:
galera-1:
image: bitnami/mariadb-galera:10.5
hostname: galera-1
#ports:
#- '3306:3306'
#- '4444:4444'
#- '4567:4567'
#- '4568:4568'
volumes:
- ./maxscale/bootstrap.sql:/docker-entrypoint-initdb.d/bootstrap.sql:ro
# - ./galera-1/data:/bitnami/mariadb # this directory should have root user and group id or 777 mode
env_file:
- .env
environment:
- MARIADB_GALERA_CLUSTER_BOOTSTRAP=1
- MARIADB_GALERA_CLUSTER_ADDRESS="gcomm://" # Galera cluster address to join. Defaults to gcomm:// on a bootstrap node.
healthcheck:
test: ['CMD', '/opt/bitnami/scripts/mariadb-galera/healthcheck.sh']
interval: 5s
timeout: 5s
retries: 6
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "10m"
max-file: "2"
galera-2:
image: bitnami/mariadb-galera:10.5
hostname: galera-2
#ports:
#- '3306:3306'
#- '4444:4444'
#- '4567:4567'
#- '4568:4568'
#volumes:
# - ./galera-2/data:/bitnami/mariadb # this directory should have root user and group id or 777 mode
env_file:
- .env
environment:
- MARIADB_GALERA_CLUSTER_ADDRESS="gcomm://galera-1:4567,galera-2:4567" # Galera cluster address to join. Defaults to gcomm:// on a bootstrap node.
healthcheck:
test: ['CMD', '/opt/bitnami/scripts/mariadb-galera/healthcheck.sh']
interval: 5s
timeout: 5s
retries: 6
depends_on:
galera-1:
condition: service_healthy
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "10m"
max-file: "2"
garbd:
build: ./galera-arbitrator
image: garbd:latest
hostname: garbd
#ports:
#- '4567:4567'
#volumes:
# - ./garbd/data:/tmp # this directory should have 777 mode
env_file:
- .env
environment:
- MARIADB_GALERA_CLUSTER_ADDRESS="gcomm://galera-1:4567,galera-2:4567"
depends_on:
galera-1:
condition: service_healthy
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "10m"
max-file: "2"
maxscale:
build: ./maxscale
image: maxscale:latest
# image: mariadb/maxscale
hostname: maxscale
#ports:
#- '3306:3306'
#- '8989:8989'
volumes:
- ./maxscale/maxscale.cnf:/etc/maxscale.cnf:ro
env_file:
- .env
depends_on:
galera-1:
condition: service_healthy
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "10m"
max-file: "2"