-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
174 lines (167 loc) · 4.63 KB
/
docker-compose.yaml
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
version: '3'
services:
etcd-01:
image: gcr.io/etcd-development/etcd:latest
hostname: etcd-01
networks:
ne-network:
ipv4_address: 10.0.0.2
environment:
TOKEN: token-01
CLUSTER_STATE: new
ALLOW_NONE_AUTHENTICATION: "yes"
ETCDCTL_API: 2
CLUSTER: machine-1=http://10.0.0.2:2380,machine-2=http://10.0.0.3:2380,machine-3=http://10.0.0.4:2380
GET_HOSTS_FROM: "dns"
ports:
- 3379:2379
- 3380:2380
command: [ "sh","-c","etcd --data-dir=data.etcd --name machine-1 \
--initial-advertise-peer-urls http://10.0.0.2:2380 --listen-peer-urls http://10.0.0.2:2380 \
--advertise-client-urls http://10.0.0.2:2379 --listen-client-urls http://10.0.0.2:2379 \
--initial-cluster $${CLUSTER} \
--initial-cluster-state $${CLUSTER_STATE} --initial-cluster-token $${TOKEN}" ]
etcd-02:
image: gcr.io/etcd-development/etcd:latest
hostname: etcd-02
networks:
ne-network:
ipv4_address: 10.0.0.3
environment:
TOKEN: token-01
CLUSTER_STATE: new
ALLOW_NONE_AUTHENTICATION: "yes"
ETCDCTL_API: 2
CLUSTER: machine-1=http://10.0.0.2:2380,machine-2=http://10.0.0.3:2380,machine-3=http://10.0.0.4:2380
GET_HOSTS_FROM: "dns"
ports:
- 4379:2379
- 4380:2380
command: [ "sh","-c","etcd --data-dir=data.etcd --name machine-2 \
--initial-advertise-peer-urls http://10.0.0.3:2380 --listen-peer-urls http://10.0.0.3:2380 \
--advertise-client-urls http://10.0.0.3:2379 --listen-client-urls http://10.0.0.3:2379 \
--initial-cluster $${CLUSTER} \
--initial-cluster-state $${CLUSTER_STATE} --initial-cluster-token $${TOKEN}" ]
etcd-03:
image: gcr.io/etcd-development/etcd:latest
hostname: etcd-03
networks:
ne-network:
ipv4_address: 10.0.0.4
environment:
TOKEN: token-01
CLUSTER_STATE: new
ALLOW_NONE_AUTHENTICATION: "yes"
ETCDCTL_API: 2
CLUSTER: machine-1=http://10.0.0.2:2380,machine-2=http://10.0.0.3:2380,machine-3=http://10.0.0.4:2380
GET_HOSTS_FROM: "dns"
ports:
- 5379:2379
- 5380:2380
command: [ "sh","-c","etcd --data-dir=data.etcd --name machine-3 \
--initial-advertise-peer-urls http://10.0.0.4:2380 --listen-peer-urls http://10.0.0.4:2380 \
--advertise-client-urls http://10.0.0.4:2379 --listen-client-urls http://10.0.0.4:2379 \
--initial-cluster $${CLUSTER} \
--initial-cluster-state $${CLUSTER_STATE} --initial-cluster-token $${TOKEN}" ]
postgres:
image: postgres:11-alpine
container_name: postgres
ports:
- 6432:5432
environment:
POSTGRES_USER: "un"
POSTGRES_PASSWORD: "pass"
POSTGRES_DB: "ne"
GET_HOSTS_FROM: "dns"
networks:
ne-network:
ipv4_address: 10.0.0.5
rabbitmq:
image: rabbitmq:3
container_name: rabbitmq
ports:
- 6672:5672
- 16672:15672
networks:
ne-network:
ipv4_address: 10.0.0.6
app-01:
image: manager-service:latest
container_name: ne_manager_01
build: ""
command: /app/manager-service
ports:
- 8080:8080
environment:
GET_HOSTS_FROM: "dns"
restart: on-failure
depends_on:
- etcd-01
- etcd-02
- etcd-03
- postgres
- rabbitmq
networks:
ne-network:
ipv4_address: 10.0.0.7
app-02:
image: manager-service:latest
container_name: ne_manager_02
build: ""
command: /app/manager-service
ports:
- 9080:8080
environment:
GET_HOSTS_FROM: "dns"
restart: on-failure
depends_on:
- etcd-01
- etcd-02
- etcd-03
- postgres
- rabbitmq
networks:
ne-network:
ipv4_address: 10.0.0.8
app-03:
image: manager-service:latest
container_name: ne_manager_03
build: ""
command: /app/manager-service
ports:
- 10080:8080
environment:
GET_HOSTS_FROM: "dns"
restart: on-failure
depends_on:
- etcd-01
- etcd-02
- etcd-03
- postgres
- rabbitmq
networks:
ne-network:
ipv4_address: 10.0.0.9
worker-01:
image: worker-service:latest
container_name: worker_01
build: ""
command: /app/worker-service
environment:
GET_HOSTS_FROM: "dns"
restart: on-failure
depends_on:
- etcd-01
- etcd-02
- etcd-03
- postgres
- rabbitmq
networks:
ne-network:
ipv4_address: 10.0.0.10
networks:
ne-network:
driver: bridge
ipam:
config:
- subnet: 10.0.0.0/16