-
-
Notifications
You must be signed in to change notification settings - Fork 266
/
docker-compose.yml
117 lines (110 loc) · 3.34 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
services:
loki:
image: grafana/loki:2.9.10
container_name: loki
hostname: loki
volumes:
- ./volume-data/loki:/etc/loki # place loki-config.yml
ports:
- "127.0.0.1:3100:3100"
expose:
- 3100
restart: unless-stopped
user: 1000:1000
command: -config.file=/etc/loki/loki-config.yml
#networks:
# - monitoring_default
promtail:
image: grafana/promtail:latest
container_name: promtail
hostname: promtail
depends_on:
- loki
volumes:
- /var/log:/var/log:ro # let promtail access the docker host's log files
- ./volume-data/promtail:/etc/promtail # place promtail-config.yml
#- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/traefik/logs:/var/log/traefik # let promtail access your traefik reverse logs
restart: unless-stopped
command: -config.file=/etc/promtail/promtail-config.yml
#networks:
# - monitoring_default
influxdb:
image: influxdb:1.8
container_name: influxdb
hostname: influxdb
restart: unless-stopped
volumes:
- ./volume-data/influxdb/data:/var/lib/influxdb
- ./volume-data/influxdb/influxdb.conf:/etc/influxdb/influxdb.conf:ro # place infuxdb.conf
- ./volume-data/influxdb/init:/docker-entrypoint-initdb.d # place create-database.iql for database init
environment:
- INFLUXDB_ADMIN_USER=admin
- INFLUXDB_ADMIN_PASSWORD=SuperDuperAdminPW
#networks:
# - monitoring_default
telegraf:
image: telegraf:latest
container_name: telegraf
hostname: telegraf
restart: unless-stopped
user: telegraf:$(stat -c '%g' /var/run/docker.sock) # see: https://www.influxdata.com/blog/docker-run-telegraf-as-non-root/
dns:
- 1.1.1.1
- 8.8.8.8
depends_on:
- influxdb
volumes:
- ./volume-data/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro # place telegraf.conf
- /:/hostfs:ro
- /etc:/hostfs/etc:ro
- /proc:/hostfs/proc:ro
- /sys:/hostfs/sys:ro
- /var/run/utmp:/var/run/utmp:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- HOST_ETC=/hostfs/etc
- HOST_PROC=/hostfs/proc
- HOST_SYS=/hostfs/sys
- HOST_MOUNT_PREFIX=/hostfs
#networks:
# - monitoring_default
grafana:
image: grafana/grafana:latest
container_name: grafana
hostname: grafana
restart: unless-stopped
user: 1000:1000
depends_on:
- influxdb
- loki
- promtail
environment:
- GF_SERVER_ROOT_URL=https://grafana.example.com # pls change this
volumes:
- ./volume-data/grafana:/var/lib/grafana
ports:
- 3000:3000
expose:
- 3000
#networks:
# - monitoring_default
#labels:
# - traefik.enable=true
# - traefik.http.routers.grafana.rule=Host(`grafana.example.com`)
# - traefik.http.services.grafana.loadbalancer.server.port=3000
# - traefik.docker.network=proxy
# # Part for local lan services only
# - traefik.http.routers.grafana.middlewares=local-ipwhitelist@file
#prometheus:
# image: prom/prometheus
# container_name: prometheus
# restart: unless-stopped
# expose:
# - 9090
# volumes:
# - ./volume-data/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
# #networks:
# # - monitoring_default
#networks:
# monitoring_default:
# external: true