-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.elastic.beats.yml
89 lines (74 loc) · 2.6 KB
/
docker-compose.elastic.beats.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
version: "3.8"
secrets:
ca.crt:
file: ${SECRETS_DIR}/elastic_stack/secrets/certificate_authority/ca/ca.crt
elastic-stack-ca.p12:
file: ${SECRETS_DIR}/elastic_stack/secrets/certificate_authority/elastic-stack-ca.p12
filebeat.key:
file: ${SECRETS_DIR}/elastic_stack/secrets/certificates/filebeat/filebeat.key
filebeat.cert:
file: ${SECRETS_DIR}/elastic_stack/secrets/certificates/filebeat/filebeat.crt
metricbeat.key:
file: ${SECRETS_DIR}/elastic_stack/secrets/certificates/metricbeat/metricbeat.key
metricbeat.cert:
file: ${SECRETS_DIR}/elastic_stack/secrets/certificates/metricbeat/metricbeat.crt
################
## NETWORKS ##
################
networks:
elastic-net:
name: elastic-net
external: true
proxy-net:
external: true
weave-net:
external: true
services:
filebeat:
container_name: filebeat
hostname: filebeat
image: docker.elastic.co/beats/filebeat:${ELK_VERSION}
restart: unless-stopped
user: root #/var/run/docker.sock
entrypoint: [ ]
command: >
bash -c '
filebeat -e \
-E setup.kibana.enabled=true \
-E setup.kibana.host=http://kibana:5601 \
-E setup.template.enabled=true \
-E setup.template.settings.index.number_of_replicas=0 \
-E http.enabled=true \
-E http.host=0.0.0.0 \
-E http.port=5066 \
-E monitoring.enabled=false \
-E output.elasticsearch.username=elastic \
-E output.elasticsearch.password=$ELASTIC__INITIAL_PASSWORD \
-E output.elasticsearch.hosts=["http://elasticsearch:9200"] \
-E monitoring.cluster_uuid=$(cat /usr/share/setup/cluster_uuid) \
'
volumes:
- ${SECRETS_DIR}/elastic_stack/filebeat/config/filebeat.yml:${FILEBEAT_DIR}/filebeat.yml:ro
environment:
CONFIG_DIR: ${FILEBEAT_DIR}/config
LS_JAVA_OPTS: "-Xmx${FILEBEAT_HEAP} -Xms${FILEBEAT_HEAP}"
secrets:
- source: ca.crt
target: ${FILEBEAT_DIR}/config/ca.crt
- source: filebeat.cert
target: ${FILEBEAT_DIR}/config/filebeat.crt
- source: filebeat.key
target: ${FILEBEAT_DIR}/config/filebeat.key
expose:
- 9000
networks:
- elastic-net
- weave-net
labels:
com.centurylinklabs.watchtower.enable: "true"
co.elastic.logs/enabled: false
co.elastic.metrics/raw: "[{\"module\":\"beat\",\"hosts\":\"filebeat:5066\",\"period\":\"10s\",\"xpack.enabled\":\"true\"}]"
healthcheck:
interval: 10s
retries: 12
test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:5066/