-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
216 lines (199 loc) · 4.35 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
version: '3.7'
networks:
my-moments:
driver: bridge
name: my-moments
ipam:
config:
- subnet: 172.21.0.0/24
services:
configuration-service:
restart: on-failure
build: ./configuration-service
networks:
- my-moments
ports:
- 8888:8888
volumes:
- /configuration-service/dir:/app
container_name: configuration-service
discovery-service:
restart: on-failure
build: ./discovery-service
networks:
- my-moments
ports:
- 8761:8761
volumes:
- /discovery-service/dir:/app
container_name: discovery-service
gateway-service:
restart: on-failure
build: ./gateway-service
networks:
- my-moments
ports:
- 8989:8989
volumes:
- /gateway-service/dir:/app
depends_on:
- discovery-service
- configuration-service
- logstash
- zipkin
- mongo-db-user-service
container_name: gateway-service
user-service:
restart: on-failure
build: ./user-service
networks:
- my-moments
ports:
- 8081:8081
environment:
- SPRING_PROFILES_ACTIVE=local
volumes:
- /user-service/dir:/app
depends_on:
- gateway-service
- rabbitmq
container_name: user-service
post-service:
restart: on-failure
build: ./post-service
networks:
- my-moments
ports:
- 8082:8082
environment:
- SPRING_PROFILES_ACTIVE=local
volumes:
- /post-service/dir:/app
depends_on:
- gateway-service
- mongo-db-post-service
- rabbitmq
container_name: post-service
comment-service:
restart: on-failure
build: ./comment-service
networks:
- my-moments
ports:
- 8083:8083
environment:
- SPRING_PROFILES_ACTIVE=local
volumes:
- /comment-service/dir:/app
depends_on:
- gateway-service
- mongo-db-comment-service
- rabbitmq
container_name: comment-service
mongo-db-user-service:
image: mongo:3.6
ports:
- 27017:27017
volumes:
- /var/lib/mongo-db-user-service:/data/db
networks:
- my-moments
container_name: mongo-db-user-service
mongo-db-post-service:
image: mongo:3.6
ports:
- 27019:27017
volumes:
- /var/lib/mongo-db-post-service:/data/db
networks:
- my-moments
container_name: mongo-db-post-service
mongo-db-comment-service:
image: mongo:3.6
ports:
- 27021:27017
volumes:
- /var/lib/mongo-db-comment-service:/data/db
networks:
- my-moments
container_name: mongo-db-comment-service
rabbitmq:
image: rabbitmq:3-management-alpine
networks:
- my-moments
environment:
RABBITMQ_DEFAULT_USER: my-moments-user
RABBITMQ_DEFAULT_PASS: my-moments-password
ports:
- 5672:5672
- 15672:15672
container_name: rabbitmq
zipkin:
image: openzipkin/zipkin:2.23.2
restart: on-failure
networks:
- my-moments
ports:
- 9411:9411
container_name: zipkin
elasticsearch:
build: ./elk/elasticsearch
restart: on-failure
networks:
- my-moments
ports:
- 9200:9200
environment:
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
container_name: elasticsearch
logstash:
build: ./elk/logstash
restart: on-failure
command: logstash -f /etc/logstash/conf.d/logstash.conf
networks:
- my-moments
ports:
- 5000:5000
- 9600:9600
environment:
LS_JAVA_OPTS: "-Xmx256m -Xms256m"
depends_on:
- elasticsearch
container_name: logstash
kibana:
build: ./elk/kibana
restart: on-failure
networks:
- my-moments
ports:
- 5601:5601
depends_on:
- elasticsearch
container_name: kibana
vault-server:
image: vault:1.8.1
restart: on-failure
ports:
- 8200:8200
networks:
my-moments:
ipv4_address: 172.21.0.10
aliases:
- vault-server
environment:
VAULT_ADDR: "http://0.0.0.0:8200"
VAULT_DEV_ROOT_TOKEN_ID: "vault-token"
cap_add:
- IPC_LOCK
container_name: vault-server
vault-client:
build: ./vault-client
restart: on-failure
networks:
my-moments:
ipv4_address: 172.21.0.20
aliases:
- vault-client
environment:
VAULT_ADDR: "http://vault-server:8200"
container_name: vault-client