-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathdocker-compose.yml
83 lines (76 loc) · 2.42 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
version: "2.2"
services:
# Used as the Metricbeat output
# Of course, we could create a cluster with more nodes
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.0.0
container_name: metricbeat-elasticsearch
memswap_limit: 0
mem_limit: 2g
cap_add:
- IPC_LOCK
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ./config/usr/share/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
ports:
- "9222:9200"
networks:
- metricbeat
# Used to analyse data sent to elasticsearch from Metricbeat.
# Metricbeat directly creates Dashbords into Kibana
kibana:
image: docker.elastic.co/kibana/kibana:6.0.0
container_name: metricbeat-kibana
volumes:
- ./config/opt/kibana/config/kibana.yml:/opt/kibana/config/kibana.yml:ro
depends_on:
- elasticsearch
ports:
- "5666:5601"
networks:
- metricbeat
# Container to monitor services running inside other containers
metricbeat:
build: ./docker/metricbeat
container_name: metricbeat-metricbeat-services
command: -e
environment:
- "WAIT_FOR_HOSTS=elasticsearch:9200 kibana:5601"
- "HOST_ELASTICSEARCH=elasticsearch:9200"
- "HOST_KIBANA=kibana:5601"
depends_on:
- elasticsearch
networks:
- metricbeat
# Specific container and configuration to monitor the HOST (filesystem, memory, processes,...)
metricbeat-host:
build:
context: ./docker/metricbeat
args:
- METRICBEAT_FILE=metricbeat-host.yml
container_name: metricbeat-metricbeat-host
command: -system.hostfs=/hostfs
volumes:
- /proc:/hostfs/proc:ro
- /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
- /:/hostfs:ro
- /var/run/docker.sock:/var/run/docker.sock
environment:
- "WAIT_FOR_HOSTS=elasticsearch:9222 kibana:5666"
- "HOST_ELASTICSEARCH=elasticsearch:9222"
- "HOST_KIBANA=kibana:5666"
extra_hosts:
- "elasticsearch:172.17.0.1" # The IP of docker0 interface to access host from container
- "kibana:172.17.0.1" # The IP of docker0 interface to access host from container
network_mode: host # Mandatory to monitor HOST filesystem, memory, processes,...
networks:
metricbeat:
external:
name: metricbeat