-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.elk.yml
109 lines (106 loc) · 4.14 KB
/
docker-compose.elk.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
version: '3.6'
networks: {elk: {}}
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.0
container_name: elasticsearch
networks: ['elk']
secrets:
- source: ca.crt
target: /usr/share/elasticsearch/config/certs/ca/ca.crt
- source: elasticsearch.yml
target: /usr/share/elasticsearch/config/elasticsearch.yml
- source: elasticsearch.keystore
target: /usr/share/elasticsearch/config/elasticsearch.keystore
- source: elasticsearch.key
target: /usr/share/elasticsearch/config/certs/elasticsearch/elasticsearch.key
- source: elasticsearch.crt
target: /usr/share/elasticsearch/config/certs/elasticsearch/elasticsearch.crt
ports: ['9200:9200']
volumes:
- ./.data/elasticsearch:/usr/share/elasticsearch/data
healthcheck:
test: curl --cacert /usr/share/elasticsearch/config/certs/ca/ca.crt -s https://localhost:9200 >/dev/null; if [[ $$? == 52 ]]; then echo 0; else echo 1; fi
interval: 30s
timeout: 10s
retries: 5
kibana:
image: docker.elastic.co/kibana/kibana:6.4.0
container_name: kibana
networks: ['elk']
secrets:
- source: kibana.yml
target: /usr/share/kibana/config/kibana.yml
- source: kibana.keystore
target: /usr/share/kibana/data/kibana.keystore
- source: ca.crt
target: /usr/share/kibana/config/certs/ca/ca.crt
- source: kibana.key
target: /usr/share/kibana/config/certs/kibana/kibana.key
- source: kibana.crt
target: /usr/share/kibana/config/certs/kibana/kibana.crt
ports: ['5601:5601']
depends_on: ['elasticsearch']
healthcheck:
test: curl --cacert /usr/share/elasticsearch/config/certs/ca/ca.crt -s https://localhost:5601 >/dev/null; if [[ $$? == 52 ]]; then echo 0; else echo 1; fi
interval: 30s
timeout: 10s
retries: 5
filebeat:
image: docker.elastic.co/beats/filebeat:6.4.0
container_name: filebeat
networks: ['elk']
user: root
# -e flag to log to stderr and disable syslog/file output
command: --strict.perms=false -e
secrets:
- source: filebeat.yml
target: /usr/share/filebeat/filebeat.yml
- source: filebeat.keystore
target: /usr/share/filebeat/filebeat.keystore
- source: ca.crt
target: /usr/share/filebeat/certs/ca/ca.crt
volumes:
#Mount the inputs directory. Users can in turn add inputs to this directory and they will be dynamically loaded
- ./filebeat/inputs.d/:/usr/share/filebeat/inputs.d/
#Mount the modules directory. Users can in turn add modules to this directory and they will be dynamically loaded
- ./filebeat/modules.d/:/usr/share/filebeat/modules.d/
#Mount the hosts system log directory. This represents the logs of the VM hosting docker. Consumed by the filebeat system module.
- /private/var/log/:/hostfs/var/log/:ro
#Mount the docker logs for indexing by the custom prospector ./config/filebeat/prospectors.d
- /var/lib/docker/containers:/var/lib/docker/containers
#Mount the docker socket to grab additional information from containers
- /var/run/docker.sock:/var/run/docker.sock
#Named volume fsdata. This is used to persist the registry file between restarts, so to avoid data duplication
- ./.data/filebeat:/usr/share/filebeat/data/
depends_on: ['elasticsearch', 'kibana']
# healthcheck:
# test: filebeat test config
# interval: 30s
# timeout: 15s
# retries: 5
secrets:
ca.crt:
file: ./ssl/ca/ca.crt
elasticsearch.yml:
file: ./elasticsearch/elasticsearch.yml
elasticsearch.keystore:
file: ./elasticsearch/elasticsearch.keystore
elasticsearch.key:
file: ./elasticsearch/elasticsearch.key
elasticsearch.crt:
file: ./elasticsearch/elasticsearch.crt
elasticsearch.p12:
file: ./elasticsearch/elasticsearch.p12
kibana.yml:
file: ./kibana/kibana.yml
kibana.keystore:
file: ./kibana/kibana.keystore
kibana.key:
file: ./kibana/kibana.key
kibana.crt:
file: ./kibana/kibana.crt
filebeat.yml:
file: ./filebeat/filebeat.yml
filebeat.keystore:
file: ./filebeat/filebeat.keystore