-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
133 lines (124 loc) · 4.33 KB
/
docker-compose.yml
File metadata and controls
133 lines (124 loc) · 4.33 KB
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
version: '2.1'
services:
# Elasticsearch container: 1-node cluster at http://elasticsearch:9200
elasticsearch:
container_name: elasticsearch
hostname: elasticsearch
image: "docker.elastic.co/elasticsearch/elasticsearch:${ELK_VERSION}"
volumes:
- 'es_data:/usr/share/elasticsearch/data'
- ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
ports:
- "9200:9200"
- "9300:9300"
environment:
- http.host=0.0.0.0
- transport.host=127.0.0.1
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms${ES_JVM_HEAP} -Xmx${ES_JVM_HEAP}"
- ELASTIC_PASSWORD=${ES_PASSWORD}
mem_limit: ${ES_MEM_LIMIT}
ulimits:
memlock:
soft: -1
hard: -1
healthcheck:
test: ["CMD", "curl","-s" ,"-f", "-u", "elastic:${ES_PASSWORD}", "http://localhost:9200/_cat/health"]
networks:
- elk
# Heartbeat container
heartbeat:
container_name: heartbeat
hostname: heartbeat
user: root # To read the docker socket
image: "docker.elastic.co/beats/heartbeat:${ELK_VERSION}"
volumes:
# Mount heartbeat configuration so we can edit
- ./heartbeat/config/heartbeat.yml:/usr/share/heartbeat/heartbeat.yml
# Allows us to report on docker from the hosts information.
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
elasticsearch: { condition: service_healthy }
kibana: { condition: service_healthy }
command: heartbeat -e -strict.perms=false
networks: ['elk']
restart: on-failure
# Metricbeat container
metricbeat:
container_name: metricbeat
hostname: metricbeat
user: root # to read the docker socket
image: docker.elastic.co/beats/metricbeat:${ELK_VERSION}
volumes:
# Mount metricbeat configuration file
- ./metricbeat/config/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml
# Mount the modules.d directory into the container so they can be dyncamically changed and reloaded
- ./metricbeat/config/modules.d/:/usr/share/metricbeat/modules.d/
# Enables Metricbeat to monitor the Docker host rather than the Metricbeat container. These are used by the system module.
- /proc:/hostfs/proc:ro
- /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
# Allows us to report on docker from the hosts information.
- /var/run/docker.sock:/var/run/docker.sock
# Mount the host filesystem so we can report on disk usage with the system module.
- /:/hostfs:ro
command: metricbeat -e -system.hostfs=/hostfs -strict.perms=false
networks: ['elk']
restart: on-failure
depends_on:
elasticsearch: { condition: service_healthy }
kibana: { condition: service_healthy }
# Filebeat container
# filebeat:
# container_name: filebeat
# hostname: filebeat
# image: "docker.elastic.co/beats/filebeat:${ELK_VERSION}"
# volumes:
# # Mount filebeat configuration
# - ./filebeat/config/filebeat.yml:/usr/share/filebeat/filebeat.yml
# # Mount log directory into container /tmp/log
# - ./test/:/var/log/
# networks:
# - elk
# restart: on-failure
# depends_on:
# elasticsearch: { condition: service_healthy }
# Logstash container
# logstash:
# image: docker.elastic.co/logstash/logstash:${ELK_VERSION}
# container_name: logstash
# hostname: logstash
# volumes:
# # Mount logstash configuration with centralized pipeline management
# - ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml:ro
# # Mount log location on host
# - ./test:/var/log/
# ports:
# - "9600:9600"
# environment:
# LS_JAVA_OPTS: "-Xmx256m -Xms256m"
# networks:
# - elk
# depends_on:
# elasticsearch: { condition: service_healthy }
# Kibana container
kibana:
container_name: kibana
hostname: kibana
image: "docker.elastic.co/kibana/kibana:${ELK_VERSION}"
volumes:
- ./kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro
ports:
- "5601:5601"
networks:
- elk
depends_on:
elasticsearch: { condition: service_healthy }
restart: on-failure
healthcheck:
test: ["CMD", "curl", "-s", "-f", "-u", "elastic:${ES_PASSWORD}", "http://localhost:5601/api/status"]
retries: 6
networks:
elk:
volumes:
es_data:
driver: local