-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose-consul.yml
179 lines (165 loc) · 3.88 KB
/
docker-compose-consul.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
version: '3.8'
x-logging:
&default-logging
driver: "json-file"
options:
max-size: "1m"
max-file: "1"
tag: "{{.Name}}"
services:
redis:
image: bitnami/redis:6.0
container_name: redis
environment:
ALLOW_EMPTY_PASSWORD: "yes"
ports:
- 6379
networks:
- lokidemo
logging: *default-logging
consul:
container_name: consul
image: consul:1.9
command: agent -log-level=info -dev -client 0.0.0.0
volumes:
- consul-config:/consul/config
- consul-data:/consul/data
ports:
- 8500:8500
networks:
- lokidemo
logging: *default-logging
minio:
image: minio/minio:RELEASE.2022-03-11T23-57-45Z
container_name: minio
entrypoint: sh
command: -c 'mkdir -p /export/loki && minio server /export'
environment:
- MINIO_ROOT_USER=697d0993dd097f38d5b8
- MINIO_ROOT_PASSWORD=9f88738761b57c63f6a81bdfd471
ports:
- 9000:9000
networks:
- lokidemo
volumes:
- minio:/export
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
logging: *default-logging
loki-distributor:
image: grafana/loki:2.4.2
container_name: loki-distributor
ports:
- 3101:3100
depends_on:
- minio
- redis
- consul
volumes:
- ./configs/loki/consul_config.yaml:/etc/loki/config.yaml
command: -config.file=/etc/loki/config.yaml -target=distributor
networks:
- lokidemo
logging: *default-logging
loki-querier:
image: grafana/loki:2.4.2
container_name: loki-querier
ports:
- 3100
depends_on:
- minio
- redis
- consul
volumes:
- ./configs/loki/consul_config.yaml:/etc/loki/config.yaml
command: -config.file=/etc/loki/config.yaml -target=querier
networks:
- lokidemo
logging: *default-logging
loki-ingester:
image: grafana/loki:2.4.2
container_name: loki-ingester
ports:
- 3100
depends_on:
- minio
- redis
- consul
volumes:
- ./configs/loki/consul_config.yaml:/etc/loki/config.yaml
command: -config.file=/etc/loki/config.yaml -target=ingester
networks:
- lokidemo
logging: *default-logging
loki-table-manager:
image: grafana/loki:2.4.2
container_name: loki-table-manager
ports:
- 3100
depends_on:
- minio
- redis
- consul
volumes:
- ./configs/loki/consul_config.yaml:/etc/loki/config.yaml
command: -config.file=/etc/loki/config.yaml -target=table-manager
networks:
- lokidemo
logging: *default-logging
nginx-app:
image: nginx
container_name: nginx-app
restart: unless-stopped
ports:
- 8084:80
networks:
- lokidemo
depends_on:
- loki-distributor
logging: *default-logging
flask-app:
image: flask-app
container_name: flask-app
build: ./flask-app
restart: unless-stopped
ports:
- 5000:5000
logging: *default-logging
promtail:
image: grafana/promtail:2.4.2
container_name: promtail
volumes:
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- ./configs/promtail/docker-config.yaml:/etc/promtail/docker-config.yaml
command: -config.file=/etc/promtail/docker-config.yaml
depends_on:
- flask-app
- loki-ingester
networks:
- lokidemo
logging: *default-logging
grafana:
image: grafana/grafana:8.4.5
container_name: grafana
ports:
- "3000:3000"
networks:
- lokidemo
depends_on:
- loki-ingester
- minio
volumes:
- ./configs/grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml
- grafana:/var/lib/grafana
logging: *default-logging
volumes:
minio: {}
grafana: {}
consul-config: {}
consul-data: {}
networks:
lokidemo:
name: lokidemo