Skip to content

Instantly share code, notes, and snippets.

@vovimayhem
Created June 6, 2017 21:17
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vovimayhem/3bf5e9ea72a5768a3744cd401462a521 to your computer and use it in GitHub Desktop.
Save vovimayhem/3bf5e9ea72a5768a3744cd401462a521 to your computer and use it in GitHub Desktop.
ELK stack example
version: "2"
volumes:
log-data:
driver: local
services:
elasticsearch:
image: elasticsearch:5.0
ports:
- "9200:9200"
- "9300:9300"
volumes:
# We'll store the elasticsearch data in the 'log-data' volume we defined:
- log-data:/usr/share/elasticsearch/data
environment:
ES_JAVA_OPTS: "-Xms1g -Xmx1g"
labels:
- "constraint:node.labels.data-host==true"
networks:
- elk
kibana:
image: kibana:5.0
ports:
- "5601:5601"
links:
- elasticsearch:foresight-log-elasticsearch
networks:
- elk
logstash:
image: logstash:5.0
command: -e 'input { gelf { type => docker port => 12201 } } output { elasticsearch { hosts => ["foresight-log-elasticsearch:9200"] } }'
ports:
- "12201:12201/udp"
links:
- elasticsearch:foresight-log-elasticsearch
networks:
- elk
networks:
elk:
driver: bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment