version: '2'

services:
  kibana:
    image: kibana
    restart: unless-stopped
    ports:
      - "5601:5601"
    depends_on:
      - elasticsearch
    environment:
      - ELASTICSEARCH_URL=http://elasticsearch:9200

  elasticsearch:
    image: elasticsearch
    restart: unless-stopped
    command: elasticsearch -Des.network.bind_host=0.0.0.0

  metricbeat:
    build: .
    restart: unless-stopped
    pid: host
    volumes:
      - ./metricbeat.yml:/metricbeat/metricbeat.yml
    depends_on:
      - elasticsearch
    environment:
      - ELASTICSEARCH_URL=http://elasticsearch:9200

version: '2'

services:
  kibana:
    image: kibana:5
    restart: unless-stopped
    ports:
      - "5601:5601"
    depends_on:
      - elasticsearch
    environment:
      - ELASTICSEARCH_URL=http://elasticsearch:9200

  elasticsearch:
    image: elasticsearch:5
    restart: unless-stopped
    command: elasticsearch -Enetwork.bind_host=0.0.0.0 -Ebootstrap.ignore_system_bootstrap_checks=true
    environment:
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g"

  metricbeat:
    build: .
    restart: unless-stopped
    pid: host
    volumes:
      - ./metricbeat.yml:/metricbeat/metricbeat.yml
    depends_on:
      - elasticsearch
    environment:
      - ELASTICSEARCH_URL=http://elasticsearch:9200

Update to check Elastic 5
Update to check Elastic 5
