-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
53 lines (50 loc) · 1.15 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
version: '2'
services:
mysqlmaster:
image: mysql:5.6
container_name: mysql-master
ports:
- '3306:3306'
environment:
- "MYSQL_ROOT_PASSWORD=root"
networks:
vpcbr:
ipv4_address: 10.20.1.2
volumes:
- ./data/mysql-master:/var/lib/mysql/
- ./config/mysql-master:/etc/mysql/conf.d/
mysqlslave:
image: mysql:5.6
container_name: mysql-slave
ports:
- '3307:3306'
environment:
- "MYSQL_ROOT_PASSWORD=root"
networks:
vpcbr:
ipv4_address: 10.20.1.3
depends_on:
- mysqlmaster
volumes:
- ./data/mysql-slave:/var/lib/mysql/
- ./config/mysql-slave:/etc/mysql/conf.d/
mysqlconfig:
image: mysql:5.6
container_name: mysql-config
environment:
- "MYSQL_SLAVE_PASSWORD=root"
- "MYSQL_MASTER_PASSWORD=root"
- "MYSQL_ROOT_PASSWORD=root"
networks:
vpcbr:
ipv4_address: 10.20.1.4
volumes:
- ./mysql_connector.sh:/tmp/mysql_connector.sh
command: /bin/bash -x /tmp/mysql_connector.sh
networks:
vpcbr:
driver: bridge
ipam:
config:
- subnet: 10.20.1.0/16
gateway: 10.20.1.1