-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
153 lines (142 loc) · 4.88 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
## Ultimate Instrumentation
## Provides
## - log collection and forwarding (logspout) (localhost:8000/logs)
## - http/tcp/udp proxying (traefik) (localhost:8080/dashboard/)
## - service discovery + dns + health-checks (consul) (localhost:8500/ui) (depends on registrator)
## - time-series DB storage (influxdb) (localhost:8086)
## - metric & event visualization (grafana) (localhost:3000)
## - distributed tracing (jaegar) (localhost:16686)
## http routing provided by traefik on `localhost/<route>` (see SERVICE_TAGS vars for routes)
version: '3'
services:
# logging
logspout:
image: "${REGISTRY}gliderlabs/logspout:master"
volumes: ['/var/run/docker.sock:/tmp/docker.sock:ro']
networks: ['infra','instrument_web']
ports: ['8000:80'] # logs avail at http://localhost:8000/logs
environment:
EXCLUDE_LABEL: logspout.exclude
# registrator
SERVICE_TAGS: 'traefik.enable=true,traefik.port=8000,traefik.docker.network=instrument_web,traefik.http.routers.router0.rule=PathPrefix(`/logs`)'
# service discovery (consul + registrator)
consul:
image: "${REGISTRY}consul:1.7"
restart: always
networks: ['infra','instrument_web']
ports:
- '8500:8500' # web ui
# - '8300:8300' # server rpc
# - '8301:8301' # lan serf tcp
# - '8301:8301/udp' # lan serf udp
# - '8600:8600' # dns tcp
# - '8600:8600/udp' # dns udp
environment:
# registrator
SERVICE_TAGS: "traefik.enable=true,traefik.docker.network=instrument_web"
labels:
- logspout.exclude
registrator:
image: "${REGISTRY}gliderlabs/registrator:master"
depends_on: ['consul']
networks: ['infra']
volumes: ['/var/run/docker.sock:/tmp/docker.sock:ro']
command: ["-internal=true", "consul://consul:8500"]
# load balancing
traefik:
image: "${REGISTRY}traefik:2.2"
depends_on: ['registrator', 'consul']
networks: ['infra','instrument_web']
ports:
- '8080:8080' # web ui
- '80:80'
command:
# - "--log.level=DEBUG"
- "--api.insecure=true"
- "--api.dashboard=true"
- "--providers.consulcatalog=true"
- "--providers.consulcatalog.endpoint.address=http://consul:8500"
- "--providers.consulcatalog.endpoint.datacenter=dc1"
- "--providers.consulcatalog.cache=true"
- "--providers.consulcatalog.exposedByDefault=false"
labels:
- logspout.exclude
#monitoring
## TODO - get loki working (in grafana)
# loki:
# image: ${REGISTRY}/grafana/loki:latest
# depends_on: ['registrator', 'consul']
# ports: ["3100:3100"]
# command: ["-config.file=/etc/loki/local-config.yaml"]
# networks: ['infra']
# environment:
# # LOGSPOUT: ignore
# SERVICE_TAGS: "traefik.enable=true,traefik.http.routers.router0.rule=PathPrefix(`/loki`)"
telegraf:
image: "${REGISTRY}telegraf:1.14-alpine"
restart: unless-stopped
networks: ['infra', 'monitor']
depends_on: ['influxdb']
labels:
- logspout.exclude
volumes:
- ./conf/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
# For docker stats
- /var/run/docker.sock:/var/run/docker.sock:ro
influxdb:
image: "${REGISTRY}influxdb:1.8-alpine"
restart: always
ports: ['8086:8086']
networks: ['monitor']
labels:
- logspout.exclude
environment:
INFLUXDB_DB: telegraf
INFLUXDB_USER: telegraf
INFLUXDB_USER_PASSWORD: 'instrument'
INFLUXDB_REPORTING_DISABLED: 'true'
# volumes:
# - influxdb-volume:/var/lib/influxdb
grafana:
image: "${REGISTRY}grafana/grafana:6.7.3"
depends_on: ['influxdb']
ports: ["3000:3000"]
networks: ['monitor', 'instrument_web']
user: "0"
labels:
- logspout.exclude
environment:
GF_SECURITY_ADMIN_PASSWORD: 'instrument'
GF_USERS_ALLOW_SIGN_UP: 'false'
# registrator
SERVICE_TAGS: 'traefik.enable=true,traefik.docker.network=instrument_web,traefik.http.routers.router0.rule=PathPrefix(`/grafana`)'
# tracing
jaeger:
image: "${REGISTRY}jaegertracing/all-in-one:1.17"
networks: ['monitor','tracing', 'instrument_web']
environment:
COLLECTOR_ZIPKIN_HTTP_PORT: 9411
labels:
- logspout.exclude
environment:
# registrator
SERVICE_TAGS: 'traefik.enable=true,traefik.docker.network=instrument_web,traefik.http.routers.router0.rule=PathPrefix(`/jaeger`)'
ports:
- '9411:9411' # zipkin
- '16686:16686' # web ui
# - '5778:5778' # http serve configs
- '6831:6831/udp' # jaeger.thrift (compact)
# - '6832:6832/udp' # jaeger.thrift (binary)
# - '14268:14268' # http accept jaeger.thrift directly
# - '14250:14250' # http accept model.proto
# Create a network for intrastructure components
networks:
infra:
monitor:
tracing:
instrument_web:
external: true
# Create local persistent volumes
# volumes:
# grafana-volume:
# influxdb-volume: