-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
90 lines (84 loc) · 2.55 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
services:
telegraf:
image: telegraf
container_name: telegraf
restart: always
volumes:
- ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro # Mount the Telegraf configuration file
- /var/run/docker.sock:/var/run/docker.sock:ro # Mount the Docker socket to collect Docker metrics
depends_on:
- influxdb
- nginx
links:
- influxdb
- nginx
ports:
- '8125:8125' # Expose Telegraf's StatsD port
networks:
- monitoring # Connect the Telegraf container to the monitoring network
telegraf_second:
image: telegraf
container_name: telegraf_second
restart: always
volumes:
- ./telegraf/telegraf_second.conf:/etc/telegraf/telegraf.conf:ro # Mount the second Telegraf configuration file
depends_on:
- influxdb
links:
- influxdb
ports:
- '8126:8126' # Expose the second Telegraf's StatsD port
networks:
- monitoring # Connect the second Telegraf container to the monitoring network
nginx:
image: nginx:alpine
container_name: nginx
restart: always
volumes:
- ./nginx:/etc/nginx/conf.d # Mount the Nginx configuration directory
ports:
- '8080:80' # Expose Nginx on port 8080
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 10s
timeout: 5s
retries: 2
networks:
- monitoring # Connect the Nginx container to the monitoring network
influxdb:
image: influxdb:1.8-alpine
container_name: influxdb
restart: always
environment:
- INFLUXDB_DB=influx
- INFLUXDB_ADMIN_USER=admin
- INFLUXDB_ADMIN_PASSWORD=admin
ports:
- '8086:8086' # Expose InfluxDB on port 8086
volumes:
- influxdb_data:/var/lib/influxdb # Mount the InfluxDB data directory
networks:
- monitoring # Connect the InfluxDB container to the monitoring network
grafana:
image: grafana/grafana-enterprise
container_name: grafana
restart: always
depends_on:
- influxdb
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
links:
- influxdb
ports:
- '3000:3000' # Expose Grafana on port 3000
volumes:
- grafana_data:/var/lib/grafana # Mount the Grafana data directory
networks:
- monitoring # Connect the Grafana container to the monitoring network
volumes:
grafana_data: {} # Volume for Grafana data
influxdb_data: {} # Volume for InfluxDB data
networks:
monitoring:
external: true # Use an external network named 'monitoring'