-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
136 lines (128 loc) · 3.61 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
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
134
135
136
version: '3.8'
services:
setup:
hostname: elk_setup
container_name: elk_setup
image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION}
user: "0"
command: >
bash -c '
echo "Setting kibana_system password";
until curl -X POST -u "elastic:${ELASTIC_PASSWORD}" -H "Content-Type: application/json" http://elastic:9200/_security/user/kibana_system/_password -d "{\"password\":\"${KIBANA_SYSTEM_PASSWORD}\"}" | grep -q "^{}"; do sleep 5; done;
echo "All done!";
'
networks:
- elk
elastic:
depends_on:
- setup
hostname: elk_elastic
container_name: elk_elastic
image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION}
restart: always
ports:
- "${ES_PORT}:9200"
environment:
ES_JAVA_OPTS: -Xms512m -Xmx512m
discovery.type: single-node
cluster.routing.allocation.disk.threshold_enabled: "false"
cluster.info.update.interval": "1m"
bootstrap.memory_lock: "true"
xpack.security.enabled: "true"
xpack.security.audit.enabled: "true"
xpack.license.self_generated.type: basic
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
ulimits:
nofile:
soft: 65535
hard: 65535
memlock:
soft: -1
hard: -1
volumes:
- elasticsearch:/usr/share/elasticsearch/data
networks:
- elk
kibana:
hostname: elk_kibana
container_name: elk_kibana
image: docker.elastic.co/kibana/kibana:${STACK_VERSION}
restart: always
environment:
ELASTICSEARCH_HOSTS: http://elastic:9200
ELASTICSEARCH_USERNAME: kibana_system
ELASTICSEARCH_PASSWORD: ${KIBANA_SYSTEM_PASSWORD}
SERVER_BASEPATH: ${SERVER_BASE_PATH}
SERVER_PUBLICBASEURL: ${SERVER_PUBLIC_BASEURL}
ports:
- "${KIBANA_PORT}:5601"
volumes:
- kibana:/usr/share/kibana/data
networks:
- elk
depends_on:
- elastic
metricbeat:
depends_on:
- elastic
- kibana
hostname: elk_metricbeat
container_name: elk_metricbeat
image: docker.elastic.co/beats/metricbeat:${STACK_VERSION}
restart: always
volumes:
- metricbeat:/usr/share/metricbeat/data
environment:
ELASTICSEARCH_HOST: http://elastic:9200
KIBANA_HOST: http://kibana:5601
ELASTICSEARCH_USERNAME: elastic
ELASTICSEARCH_PASSWORD: ${ELASTIC_PASSWORD}
networks:
- elk
filebeat:
depends_on:
- elastic
- kibana
- logstash
hostname: elk_filebeat
container_name: elk_filebeat
image: docker.elastic.co/beats/filebeat:${STACK_VERSION}
restart: always
environment:
ELASTICSEARCH_HOSTS: http://elastic:9200
ELASTICSEARCH_USERNAME: elastic
ELASTICSEARCH_PASSWORD: ${ELASTIC_PASSWORD}
KIBANA_HOST: http://kibana:5601
LOGSTASH_HOST: logstash:5400
volumes:
- filebeat:/usr/share/filebeat/data
- /var/log:/var/log:ro
networks:
- elk
logstash:
depends_on:
- elastic
hostname: elk_logstash
container_name: elk_logstash
image: docker.elastic.co/logstash/logstash:${STACK_VERSION}
restart: always
environment:
LS_JAVA_OPTS: -Xms256m -Xmx256m
ELASTICSEARCH_HOSTS: http://elastic:9200
ELASTICSEARCH_USERNAME: elastic
ELASTICSEARCH_PASSWORD: ${ELASTIC_PASSWORD}
ports:
- "5044:5044"
- "5959:5959"
volumes:
- ./logstash/logstash.yml:/usr/share/logstash/config/logstash.yml:ro
- ./logstash/logstash.conf:/usr/share/logstash/pipeline/logstash.conf:ro
networks:
- elk
networks:
elk:
volumes:
elasticsearch:
filebeat:
kibana:
metricbeat: