-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
152 lines (145 loc) · 3.51 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
version: '2'
#version: '3.1'
services:
eurekaService:
image: karan11112/eureka-service:latest
ports:
- "8761:8761"
networks:
mysqlcluster:
ipv4_address: 172.28.0.20
gatewayService:
image: karan11112/gateway-service:latest
ports:
- "8080:8080"
links:
- eurekaService
- flask-app
networks:
mysqlcluster:
ipv4_address: 172.28.0.21
management1:
image: mysql/mysql-cluster
volumes:
- ./mysql.conf/my.cnf:/etc/my.cnf:ro
- ./mysql.conf/mysql-cluster.cnf:/etc/mysql-cluster.cnf:ro
command: "ndb_mgmd --ndb-nodeid=1"
#command: ndb_mgmd
networks:
mysqlcluster:
# ipv4_address: 192.168.0.2
ipv4_address: 172.28.0.2
ndb1:
image: mysql/mysql-cluster
volumes:
- ./mysql.conf/my.cnf:/etc/my.cnf:ro
- ./mysql.conf/mysql-cluster.cnf:/etc/mysql-cluster.cnf:ro
#command: bash -c 'sleep 40; exec ndbd'
command: ndbd
depends_on:
- "management1"
networks:
mysqlcluster:
# ipv4_address: 192.168.0.3
ipv4_address: 172.28.0.3
ndb2:
image: mysql/mysql-cluster
volumes:
- ./mysql.conf/my.cnf:/etc/my.cnf:ro
- ./mysql.conf/mysql-cluster.cnf:/etc/mysql-cluster.cnf:ro
#command: bash -c 'sleep 40; exec ndbd'
command: ndbd
depends_on:
- "management1"
networks:
mysqlcluster:
# ipv4_address: 192.168.0.4
ipv4_address: 172.28.0.4
mysql1:
image: mysql/mysql-cluster
ports:
- "3306:3306"
volumes:
- ./mysql.conf/my.cnf:/etc/my.cnf:ro
- ./mysql.conf/mysql-cluster.cnf:/etc/mysql-cluster.cnf:ro
# restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: bdteste
MYSQL_USER: teste
MYSQL_PASSWORD: teste
MYSQL_ROOT_HOST: '%'
#command: bash -c 'sleep 60; exec mysqld'
command: mysqld
depends_on:
- "management1"
- "ndb1"
- "ndb2"
networks:
mysqlcluster:
# ipv4_address: 192.168.0.10
ipv4_address: 172.28.0.10
mysql2:
image: mysql/mysql-cluster
ports:
- "3316:3306"
volumes:
- ./mysql.conf/my.cnf:/etc/my.cnf:ro
- ./mysql.conf/mysql-cluster.cnf:/etc/mysql-cluster.cnf:ro
# restart: always
environment:
MYSQL_ROOT_PASSWORD: example
#command: bash -c 'sleep 60; exec mysqld'
command: mysqld
depends_on:
- "management1"
- "ndb1"
- "ndb2"
networks:
mysqlcluster:
# ipv4_address: 192.168.0.11
ipv4_address: 172.28.0.11
adminer:
image: adminer
restart: always
ports:
- 8081:8080
links:
- mysql1:db
networks:
mysqlcluster:
redis:
image: redis:latest
ports:
- 6379:6379
volumes:
- ./config/redis.conf:/redis.conf
command: [ "redis-server", "/redis.conf" ]
networks:
mysqlcluster:
flask-app:
build: .
depends_on:
- mysql1
- mysql2
- redis
- eurekaService
restart: unless-stopped
links:
- mysql1
- mysql2
- redis
- eurekaService
networks:
mysqlcluster:
networks:
mysqlcluster:
# driver: overlay
driver: bridge
ipam:
config:
# - subnet: 192.168.0.0/16
- subnet: 172.28.0.0/16
gateway: 172.28.5.254
## - ip-range: 172.28.5.0/24
# docker run -it -v "$PWD/mysql.conf/my.cnf:/etc/my.cnf:ro" -v "$PWD/mysql.conf/mysql-cluster.cnf:/etc/mysql-cluster.cnf:ro" --net=mysqlcluster_mysqlcluster mysql/mysql-cluster ndb_mgm