-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
78 lines (71 loc) · 1.69 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
version: "3.7"
services:
server-1: &server
image: "mysql/mysql-server:${MYSQL_VERSION}"
ports:
- "30001:3306"
- "40001:33060"
command:
- "--server_id=1"
environment:
- MYSQL_ROOT_PASSWORD
- MYSQL_ROOT_HOST
volumes:
- "./my.cnf:/etc/my.cnf"
- "./data/server-1:/var/lib/mysql"
restart: always
server-2:
<<: *server
ports:
- "30002:3306"
- "40002:33060"
command:
- "--server_id=2"
volumes:
- "./my.cnf:/etc/my.cnf"
- "./data/server-2:/var/lib/mysql"
server-3:
<<: *server
ports:
- "30003:3306"
- "40003:33060"
command:
- "--server_id=3"
volumes:
- "./my.cnf:/etc/my.cnf"
- "./data/server-3:/var/lib/mysql"
shell:
image: "mysql/mysql-server:${MYSQL_VERSION}"
entrypoint: "/bin/shell-entrypoint"
environment: &other-environment
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_HOST
- MYSQL_PORT
- MYSQL_CLUSTER_NAME
- MYSQL_CLUSTER_OPTIONS
- MYSQL_INNODB_NUM_MEMBERS
volumes:
- "./shell-entrypoint.sh:/bin/shell-entrypoint"
depends_on: &other-depends
- server-1
- server-2
- server-3
router:
image: "mysql/mysql-router:${MYSQL_VERSION}"
ports:
- "6446:6446"
- "6447:6447"
environment: *other-environment
volumes:
- "./data/router:/var/lib/mysqlrouter"
depends_on: *other-depends
restart: always
prometheus-exporter:
image: "prom/mysqld-exporter"
ports:
- "9104:9104"
environment:
DATA_SOURCE_NAME: "${MYSQL_USER}:${MYSQL_PASSWORD}@(${MYSQL_HOST}:${MYSQL_PORT})/"
depends_on: *other-depends
restart: always