Skip to content

Instantly share code, notes, and snippets.

@RemiBou
Created July 4, 2019 14:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RemiBou/d2ea457fb8479ecb0e941673a27c5e2f to your computer and use it in GitHub Desktop.
Save RemiBou/d2ea457fb8479ecb0e941673a27c5e2f to your computer and use it in GitHub Desktop.
version: '3.4'
x-logging: &logging
logging:
driver: "json-file"
options:
max-size: 10M
max-file: 1
services:
fluentd:
image: $INTERNAL_REGISTRY/fluentd
build:
context: .
dockerfile: Dockerfile
volumes:
- fluentdlog:/fluentd/log
ports:
- "24224:24224"
- "24224:24224/udp"
<<: *logging
deploy:
mode: global
elasticsearch:
image: elasticsearch:7.0.1
environment:
- discovery.type=single-node # this should not be used in production see https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html, but here it's only for logging
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
<<: *logging
ports:
- "9200:9200"
deploy:
placement:
constraints: [node.role == manager]
resources:
limits:
memory: 990000MB
volumes:
- elasticsearch-data3:/usr/share/elasticsearch/data
healthcheck:
test: curl http://localhost:9200 >/dev/null; if [[ $$? == 52 ]]; then echo 0; else echo 1; fi
interval: 30s
timeout: 10s
retries: 5
kibana:
image: kibana:7.0.1
ports:
- "5601:5601"
<<: *logging
healthcheck:
test: curl -s http://localhost:5601 >/dev/null; if [[ $$? == 52 ]]; then echo 0; else echo 1; fi
interval: 30s
timeout: 10s
retries: 5
depends_on: ['elasticsearch']
deploy:
placement:
constraints: [node.role == manager]
resources:
limits:
memory: 500MB
configs:
- source: kibanacfg
target: /usr/share/kibana/config/kibana.yml
kibana-apm-server:
image: docker.elastic.co/apm/apm-server:7.0.1
configs:
- source: kibanaapmcfg2
target: /usr/share/apm-server/apm-server.yml
depends_on: ['kibana']
<<: *logging
kibana-metrics-beat:
image: docker.elastic.co/beats/metricbeat:7.1.0
depends_on: ['kibana']
environment:
- system.hostfs=/hostfs
- "WAIT_FOR_HOSTS=localhost:9200 kibana:5601"
- "HOST_ELASTICSEARCH=localhost:9200"
- "HOST_KIBANA=kibana:5601"
extra_hosts:
- "elasticsearch:172.17.0.1" # The IP of docker0 interface to access host from container
- "kibana:172.17.0.1" # The IP of docker0 interface to access host from container
command: -system.hostfs=/hostfs
deploy:
mode: global
networks:
- outside
volumes:
- type: bind
source: /proc
target: /hostfs/proc
read_only: true
- type: bind
source: /sys/fs/cgroup
target: /hostfs/sys/fs/cgroup
read_only: true
- type: bind
source: /
target: /hostfs
read_only: true
<<: *logging
# this service cleansup old data
curator:
image: stefanprodan/es-curator-cron
environment:
- "PERIOD=daily"
- "KEEP_DAYS=30"
- "INDEX_PREFIX=*"
command: "--host elasticsearch --port 9200"
volumes:
elasticsearch-data3:
driver: "local"
driver_opts:
type: none
device: /swarm/volumes/elasticsearch
o: bind
fluentdlog:
driver: local
networks:
outside:
external:
name: "host"
configs:
kibanacfg:
file: ./Logging/kibana.yml
kibanaapmcfg2:
file: ./Logging/kibana-apm.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment