-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
156 lines (137 loc) · 3.19 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
version: "3"
volumes:
logs:
services:
#
# Container to make fake logs
#
logs:
build:
context: docker/logs
dockerfile: "Dockerfile"
volumes:
- logs:/logs/
restart: "always"
#
# Tool container for importing/exporting dashboards.
#
tools:
build:
context: docker/tools
dockerfile: "Dockerfile"
volumes:
- .:/mnt
- logs:/logs/
restart: "always"
#
# Container to continuously ping hosts.
#
ping:
build:
context: docker/ping
dockerfile: "Dockerfile"
environment:
#
# Host to ping. Can be hostname or IP. Space-delimited.
# Note that DNS lookups may fail, so consider pinging some IPs...
#
HOSTS: "google.com amazon.com google-dns cloudflare-dns "
#
# Comment the previous line and uncomment this one if you'd like to ping
# some hosts on different continents.
#
#HOSTS: "google.com amazon.com google-dns cloudflare-dns cheetah.jp leopard.se"
volumes:
- logs:/logs/
- ./hosts.txt:/etc/hosts
restart: "always"
#
# Get metrics from ping logs for Prometheus.
#
ping-metrics:
build:
context: docker/ping-metrics
dockerfile: "Dockerfile"
volumes:
- .:/mnt
- logs:/logs/
restart: "always"
#
# Container to read metrics from SEPTA Regional Rail.
#
septa:
build:
context: docker/septa
dockerfile: "Dockerfile"
volumes:
- .:/mnt
- logs:/logs/
restart: "always"
#
# Read logs from files and ingest into Loki.
#
promtail:
#image: grafana/promtail:2.3.0
image: grafana/promtail:latest
volumes:
- logs:/logs/
- ./config:/mnt/config
- ./data/promtail:/mnt/var
- /var/log:/var/log
command: -config.file=/mnt/config/promtail-config-docker.yaml
ports:
- "9081:9080"
restart: "always"
#
# Telegraf reads system metrics, and will expose them to Prometheus and send them to Loki
#
telegraf:
image: telegraf:1.20
volumes:
- ./config/telegraf.conf:/etc/telegraf/telegraf.conf
restart: "always"
#
# The Loki database for storing logs.
#
loki:
#image: grafana/loki:2.3.0
#image: grafana/loki:2.6.1
image: grafana/loki:latest
user: root
volumes:
- ./config:/mnt/config
- ./data/loki-data:/tmp/loki
- ./data/loki-wal:/tmp/wal
command: -config.file=/mnt/config/loki-config.yaml
ports:
- "3100:3100"
restart: "always"
#
# Prometheus
#
prometheus:
image: prom/prometheus
#
# Not thrilled with having to run as root in the container, but trying
# to run this in a Linux VM has permission issues, since Docker commands
# are normally run as root...
#
user: root
ports:
- "9090:9090"
volumes:
- ./data/prometheus:/prometheus
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
restart: "always"
#
# Grafana, for viewing via the UI.
#
grafana:
image: grafana/grafana:latest
# Running this as root for the same reason Prometheus is running as root.
user: root
volumes:
- ./data/grafana:/var/lib/grafana
ports:
- "3000:3000"
restart: "always"