-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
223 lines (205 loc) · 5.84 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
version: '3.1'
services:
registrator:
image: gliderlabs/registrator:vendor
restart: always
volumes:
- /var/run/docker.sock:/tmp/docker.sock
# setting `-internal=true` will cause linkerd and namerd to fail silently
command: -ip=docker.for.mac.localhost -deregister=always -cleanup -tags=registrator consul://consul:8500
networks:
discovery:
consul:
image: consul:1.0.6
restart: always
ports:
- 127.0.0.1:8500:8500
networks:
discovery:
traefik:
image: traefik:1.6
restart: always
ports:
- 127.0.0.1:8080:8080
- 127.0.0.1:80:80
volumes:
- $PWD/config/traefik.toml:/etc/traefik/traefik.toml
- /var/run/docker.sock:/var/run/docker.sock
networks:
discovery:
tracing:
image: jaegertracing/all-in-one:1.3.0
restart: always
ports:
- 127.0.0.1:5775:5775/udp
- 127.0.0.1:6831:6831/udp
- 127.0.0.1:6832:6832/udp
- 127.0.0.1:5778:5778/tcp
- 127.0.0.1:16686:16686
- 127.0.0.1:14268:14268
# - 127.0.0.1:9411:9411
environment:
- COLLECTOR_ZIPKIN_HTTP_PORT=9411
- SERVICE_IGNORE=true
prometheus:
image: prom/prometheus:v2.2.1
restart: always
volumes:
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- 127.0.0.1:9090:9090
grafana:
image: grafana/grafana:5.0.4
restart: always
ports:
- 127.0.0.1:3000:3000
environment:
- SERVICE_IGNORE=true
linkerd:
image: buoyantio/linkerd:1.3.7
ports:
- 127.0.0.1:9990:9990 # Admin
- 127.0.0.1:4140:4140 # Ingress/Outgoing
- 127.0.0.1:4141:4141 # Outgress/Incoming
volumes:
- $PWD/config/linkerd.yaml:/config.yaml
command: /config.yaml
environment:
- SERVICE_IGNORE=true
networks:
discovery:
# Health check: "path": "/admin/ping"
namerd:
image: buoyantio/namerd:1.3.7
ports:
- 127.0.0.1:9991:9991 # Admin
- 127.0.0.1:4100:4100 # Thrift
- 127.0.0.1:4180:4180 # HTTP
volumes:
- $PWD/config/namerd.yaml:/config.yaml
command: /config.yaml
environment:
- SERVICE_IGNORE=true
networks:
discovery:
# Demonstrate service discovery and load-balancing, retries, circuit-breaker etc with traefik
echo:
image: hsnylmz008/echo:0.0.3
restart: always
environment:
- SERVICE_NAME=echo
- SERVICE_REGION=ap-southeast-1
- SERVICE_TAGS=traefik.enable=true,traefik.backend=echo,traefik.frontend.entryPoints=http,traefik.frontend.rule=Host:echo.consul.localhost,traefik.frontend.passHostHeader=true
# ,traefik.backend.circuitbreaker.expression="NetworkErrorRatio() > 0.5",traefik.backend.maxconn.amount=10,traefik.backend.maxconn.extractorfunc=client.ip
ports:
- 127.0.0.1::8080
networks:
proxy:
log:
# Demonstrates blue-green deployment, circuit-breaker etc with Linkerd and Namerd
blue:
image: hsnylmz008/echo:0.0.3
restart: always
environment:
- SERVICE_NAME=blue
- SERVICE_REGION=ap-southeast-1
- SERVICE_TAGS=blue
- TEXT=blue
ports:
- 127.0.0.1::8080
networks:
proxy:
green:
image: hsnylmz008/echo:0.0.3
restart: always
environment:
- SERVICE_NAME=green
- SERVICE_REGION=ap-southeast-1
- SERVICE_TAGS=green
- TEXT=green
ports:
- 127.0.0.1::8080
networks:
proxy:
# Services: mathsvc, thissvc, etc
# Storage: mongo, postgres
# Telemetry: Jaeger, Prometheus
# Cache: Redis
# Logging: EFK stack
# Visualization: Kibana, Grafana
# Key-Value, Service Discovery: Registrator, Consul
# Security: Vault
# Load-Balancer: Traefik
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.3
environment:
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "http.port=9200"
- "http.cors.allow-origin=http://127.0.0.1:1358"
- "http.cors.enabled=true"
- "http.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization"
- "http.cors.allow-credentials=true"
ports:
- 127.0.0.1:9200:9200
- 127.0.0.1:9300:9300
# # Uncomment to enable persistent storage to elasticsearch
# volumes:
# - ./tmp/elastichsearch:/usr/share/elasticsearch/data
kibana:
image: docker.elastic.co/kibana/kibana:6.2.3
environment:
ELASTICSEARCH_URL: http://elasticsearch:9200
ports:
- 127.0.0.1:5601:5601
dejavu:
image: appbaseio/dejavu:latest
ports:
- 127.0.0.1:1358:1358
# You need to build the fluentd docker image
# to install the elasticsearch gem plugin
fluentd:
build: ./fluentd
ports:
- 127.0.0.1:24224:24224
- 127.0.0.1:24224:24224/udp
volumes:
- ./config:/fluentd/etc
environment:
- FLUENTD_CONF=fluentd.conf
web:
image: httpd
ports:
- 127.0.0.1::80
logging:
driver: fluentd
options:
tag: docker.httpd
environment:
- SERVICE_NAME=httpd
- SERVICE_REGION=ap-southeast-1
- SERVICE_TAGS=traefik.enable=true,traefik.backend=httpd,traefik.frontend.entryPoints=http,traefik.frontend.rule=Host:httpd.consul.localhost
networks:
proxy:
log:
zipkin:
image: openzipkin/zipkin:2.7.0
ports:
# Uncomment if you set SCRIBE_ENABLED=true
# - 127.0.0.1:9410:9410
# Port used for the Zipkin UI and HTTP Api
- 127.0.0.1:9411:9411
environment:
# Point the zipkin at the storage backend
- STORAGE_TYPE=elasticsearch
- STORAGE_PORT_9200_TCP_ADDR=elasticsearch
# Uncomment to enable scribe
# - SCRIBE_ENABLED=true
# Uncomment to enable self-tracing
# - SELF_TRACING_ENABLED=true
# Uncomment to enable debug logging
# - JAVA_OPTS=-Dlogging.level.zipkin=DEBUG -Dlogging.level.zipkin2=DEBUG
networks:
proxy:
discovery:
log: