version: '2.4'

services:
  elasticsearch:
    image: ${DOCKER_REGISTRY}elasticsearch
    container_name: elasticsearch
    build:
      context: elasticsearch/
      args:
        ELK_VERSION: $ELK_VERSION
    healthcheck:
      # test: curl --cacert /usr/share/elasticsearch/config/certificates/ca/ca.crt -s https://localhost:9200 >/dev/null; if [[ $$? == 52 ]]; then echo 0; else echo 1; fi
      interval: 30s
      timeout: 10s
      retries: 5
  
  logstash:
    image: ${DOCKER_REGISTRY}logstash
    container_name: logstash
    build:
      context: logstash/
      args:
        ELK_VERSION: $ELK_VERSION
    depends_on:
      - elasticsearch

  kibana:
    image: ${DOCKER_REGISTRY}kibana
    build:
      context: kibana/
      args:
        ELK_VERSION: $ELK_VERSION
    depends_on:
      - elasticsearch
  filebeat:
    image: ${DOCKER_REGISTRY}filebeat
    build:
      context: filebeat/
      args:
        ELK_VERSION: $ELK_VERSION
    depends_on:
      - logstash

