/
docker-compose.yml
282 lines (264 loc) · 6.54 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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
version: "3.4"
services:
identity:
build:
context: ./app/identity/http/target/docker/stage
volumes:
- "./credentials/:/credentials/:ro"
ports:
- 9001:9001
networks:
- nw-sandbox
environment:
KATSUBUSHI_HOST: katsubushi
KATSUBUSHI_PORT: 11212
JAEGER_COLLECTOR_HOST: jaeger-collector
JAEGER_QUERY_HOST: jaeger-query
JAEGER_AGENT_HOST: jaeger-agent
JAEGER_PORT_QUERY_HTTP: 80
JAEGER_PORT_AGENT_ZIPKIN_THRIFT: 5775
JAEGER_PORT_AGENT_COMPACT: 6831
JAEGER_PORT_AGENT_BINARY: 6832
JAEGER_PORT_ZIPKIN_COLLECTOR: 14268
depends_on:
- katsubushi
- jaeger-collector
- jaeger-agent
- fluentd
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: docker.scala.identity.{{.ID}}
fluentd-async-connect: "true"
katsubushi:
image: katsubushi/katsubushi
ports:
- 11212:11212
expose:
- 11212
networks:
- nw-sandbox
command: -redis redis://redis:6379/0
depends_on:
- redis
- fluentd
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: docker.katsubushi.{{.ID}}
fluentd-async-connect: "true"
redis:
image: redis
ports:
- 6379:6379
networks:
- nw-sandbox
message:
build:
context: ./app/message/http/target/docker/stage
volumes:
- "./credentials/:/credentials/:ro"
ports:
- 9002:9002
- 8082:8082
networks:
- nw-sandbox
env_file:
- .env
environment:
PGHOST: postgres
PGPORT: 5432
IDENTITY_HOST: nginx
IDENTITY_PORT: 8080
JAEGER_COLLECTOR_HOST: jaeger-collector
JAEGER_QUERY_HOST: jaeger-query
JAEGER_AGENT_HOST: jaeger-agent
JAEGER_PORT_QUERY_HTTP: 80
JAEGER_PORT_AGENT_ZIPKIN_THRIFT: 5775
JAEGER_PORT_AGENT_COMPACT: 6831
JAEGER_PORT_AGENT_BINARY: 6832
JAEGER_PORT_ZIPKIN_COLLECTOR: 14268
depends_on:
- postgres
- identity
- jaeger-collector
- jaeger-agent
- fluentd
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: docker.scala.message.{{.ID}}
fluentd-async-connect: "true"
flyway:
build:
context: ./docker/flyway
volumes:
- ./migration:/flyway/sql
networks:
- nw-sandbox
depends_on:
- postgres
env_file:
- .env
environment:
PGHOST: postgres
PGPORT: 5432
FLYWAY_URL: jdbc:postgresql://postgres:5432/sandbox
command: migrate
postgres:
image: postgres:10
ports:
- 5432:5432
expose:
- 5432
networks:
- nw-sandbox
volumes:
- vol-pg-data:/var/lib/postgresql/data
env_file:
- .env
nginx:
image: opentracing/nginx-opentracing
networks:
- nw-sandbox
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./docker/nginx/jaeger-config.json:/etc/jaeger-config.json
- ./docker/nginx/zipkin-config.json:/etc/zipkin-config.json
ports:
- 8080:8080
depends_on:
- message
- identity
- jaeger-collector
- jaeger-agent
- fluentd
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: docker.nginx.{{.ID}}
fluentd-async-connect: "true"
nginx-exporter:
image: nginx/nginx-prometheus-exporter:0.1.0
networks:
- nw-sandbox
ports:
- 9113:9113
command:
- '-nginx.scrape-uri'
- http://nginx:8080/stub_status
depends_on:
- nginx
jaeger-collector:
image: jaegertracing/jaeger-collector:1.7
environment:
- SPAN_STORAGE_TYPE=elasticsearch
command:
- "--es.server-urls=http://elasticsearch:9200"
- "--collector.zipkin.http-port=9411"
networks:
- nw-sandbox
ports:
- 9411:9411 # The http port for the Zipkin collector service
- 14267:14267 # The tchannel port for the collector service
- 14268:14268 # The http port for the collector service
- 14269:14269 # health check
restart: on-failure # elasticsearch startup is slow
depends_on:
- elasticsearch
jaeger-agent:
image: jaegertracing/jaeger-agent:1.7
command:
- "--collector.host-port=jaeger-collector:14267"
# - "--reporter.tchannel.collector.host-port=jaeger-collector:14267"
networks:
- nw-sandbox
ports:
- 5775:5775/udp # agent zipkin host:port for the UDP server
- 6831:6831/udp # agent jaeger-compact host:port for the UDP server
- 6832:6832/udp # agent jaeger-binary host:port for the UDP server
- 5778:5778 # agent host:port of the http server
restart: on-failure # elasticsearch startup is slow
depends_on:
- jaeger-collector
jaeger-query:
image: jaegertracing/jaeger-query:1.7
environment:
- SPAN_STORAGE_TYPE=elasticsearch
command:
- "--es.server-urls=http://elasticsearch:9200"
networks:
- nw-sandbox
ports:
- 16686:16686 # query The port for the query service
- 16687:16687 # The http port for the health check service
restart: on-failure # elasticsearch startup is slow
depends_on:
- elasticsearch
fluentd:
build: ./docker/fluentd/
environment:
FLUENTD_CONF: fluent.conf
FLUENTD_OPT: -v
TZ: "Asia/Tokyo"
ports:
- 24224:24224
- 24224:24224/udp
networks:
- nw-sandbox
depends_on:
- elasticsearch
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.2
ports:
- 9200:9200
- 9300:9300
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- vol-es-data:/usr/share/elasticsearch/data
networks:
- nw-sandbox
kibana:
image: docker.elastic.co/kibana/kibana:6.4.2
ports:
- 5601:5601
depends_on:
- elasticsearch
networks:
- nw-sandbox
prometheus:
image: prom/prometheus
volumes:
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- vol-prom-data:/prometheus
ports:
- 9090:9090
depends_on:
- message
- jaeger-collector
- jaeger-agent
- jaeger-query
- nginx-exporter
networks:
- nw-sandbox
volumes:
vol-pg-data:
driver: local
vol-es-data:
driver: local
vol-prom-data:
driver: local
networks:
nw-sandbox:
driver: bridge