forked from flopex/docker-orchestrator-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
120 lines (111 loc) · 2.39 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
---
version: '2.1'
services:
db1:
hostname: db1
build: https://github.com/flopex/docker-mysql-replication.git#:5.7
healthcheck:
test: "mysqladmin ping -ppassword"
environment: &db_default_env
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: test_user
MYSQL_PASSWORD: test_password
MYSQL_DATABASE: test_db
REPLICATION_USER: repl_user
REPLICATION_PASSWORD: repl_password
networks:
main:
aliases:
- master
- db1
db2:
hostname: db2
build: https://github.com/flopex/docker-mysql-replication.git#:5.7
environment: &db_replica_env
<<: *db_default_env
MASTER_HOST: db1
MASTER_PORT: 3306
SERVER_ID: 2
depends_on: &db_replica_depends_on
db1:
condition: service_healthy
networks:
main:
aliases:
- db2
db3:
hostname: db3
build:
context: https://github.com/flopex/docker-mysql-replication.git#:5.7
environment:
<<: *db_replica_env
SERVER_ID: 3
depends_on: *db_replica_depends_on
networks:
main:
aliases:
- db3
db4:
hostname: db4
build:
context: https://github.com/flopex/docker-mysql-replication.git#:5.7
environment:
<<: *db_replica_env
SERVER_ID: 4
depends_on: *db_replica_depends_on
networks:
main:
aliases:
- db4
orchestrator1:
hostname: orchestrator1
build: .
volumes: &orc_vols
- ./docker/entrypoint.sh:/entrypoint.sh:ro
ports:
- 3331:3000
environment: &orc_env
ORC_TOPOLOGY_USER: root
ORC_TOPOLOGY_PASSWORD: password
networks:
main:
aliases:
- orchestrator1
orchestrator2:
hostname: orchestrator2
build: .
volumes: *orc_vols
ports:
- 3332:3000
environment: *orc_env
networks:
main:
aliases:
- orchestrator2
orchestrator3:
hostname: orchestrator3
build: .
volumes: *orc_vols
ports:
- 3333:3000
environment: *orc_env
networks:
main:
aliases:
- orchestrator3
haproxy:
image: haproxy:1.8
depends_on:
- orchestrator1
- orchestrator2
- orchestrator3
ports:
- 8080:80
volumes:
- ./docker/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
networks:
main:
aliases:
- haproxy
networks:
main: