forked from bergerx/docker-mysql-replication
-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
44 lines (41 loc) · 1.02 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
version: '3'
services:
db_master:
image: jamiejackson/mariadb-replication:10.2
container_name: db_master
ports:
- "3307:3306"
restart: unless-stopped
environment:
#- MYSQL_ALLOW_EMPTY_PASSWORD=1
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
db_slave1:
image: jamiejackson/mariadb-replication:10.2
container_name: db_slave1
depends_on:
- "db_master"
ports:
- "3308:3306"
links:
- db_master:master
restart: unless-stopped
environment:
#- MYSQL_ALLOW_EMPTY_PASSWORD=1
- MASTER_HOST=master
- MASTER_PORT=3306
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
db_slave2:
image: jamiejackson/mariadb-replication:10.2
container_name: db_slave2
depends_on:
- "db_master"
ports:
- "3309:3306"
links:
- db_master:master
restart: unless-stopped
environment:
#- MYSQL_ALLOW_EMPTY_PASSWORD=1
- MASTER_HOST=master
- MASTER_PORT=3306
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}