forked from callistaenterprise/blog-microservices
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-elk.yml
63 lines (57 loc) · 1.9 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
# Started with:
#
# docker-compose -f docker-compose-elk.yml up -d
# docker-compose -f docker-compose-elk.yml logs -f
# docker-compose -f docker-compose-elk.yml exec logstash /bin/bash
# ps -eax | more
#
# NO LONGER REQUIRED SINCE WE HARDCODE THE INTERNAL IP ADDRESS OF THE IP HOST!
# First run the command:
#
# export LOGSTASH_ADDRESS=$(docker inspect --format '{{ .NetworkSettings.Networks.blogmicroservices_default.IPAddress }}' blogmicroservices_logstash_1) && echo $LOGSTASH_ADDRESS
#
version: '2.1'
services:
# docker run -p 9200:9200 -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" docker.elastic.co/elasticsearch/elasticsearch:5.3.0
# docker run -p 9200:9200 -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" docker.elastic.co/elasticsearch/elasticsearch:5.2.2
# docker inspect --format='{{json .State.Health.Status}}' blogmicroservices_elasticsearch_1
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.2.2
# image: elasticsearch-custom
ports:
- "9200:9200"
environment:
- "xpack.security.enabled=false"
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9200"]
interval: 10s
timeout: 5s
retries: 10
kibana:
image: docker.elastic.co/kibana/kibana:5.2.2
ports:
- "5601:5601"
environment:
- "xpack.security.enabled=false"
depends_on:
elasticsearch:
condition: service_healthy
logstash:
image: docker.elastic.co/logstash/logstash:5.2.2
ports:
- "12201:12201"
- "27000:27000"
- "25826:25826"
- "26000:26000"
volumes:
- $PWD/elk-config:/elk-config
command: logstash -f /elk-config/logstash.config
depends_on:
elasticsearch:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080"]
interval: 10s
timeout: 5s
retries: 10