version: '2.2'

services:
  delete-indexes:
    image: playdingnow/delete-outdated-es-indexes:1.3
    environment:
      - eshost=elasticsearch
      - esport=9200
      - esmaxdays=15
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.5.0
    environment:
      - discovery.type=single-node
      - xpack.security.enabled=false
      - ES_JAVA_OPTS=-Xms512m -Xmx512m
    ports:
      - 9200:9200
    healthcheck:
      test: ['CMD', 'curl', '-f', 'http://localhost:9200']
      interval: 10s
      timeout: 5s
      retries: 3
  kibana:
    image: docker.elastic.co/kibana/kibana:7.5.0
    ports:
      - 5601:5601
    healthcheck:
      test: ['CMD', 'curl', '-f', 'http://localhost:5601']
      interval: 10s
      timeout: 5s
      retries: 3
    depends_on:
      elasticsearch:
        condition: service_healthy
  apm-server:
    image: docker.elastic.co/apm/apm-server:7.5.0
    ports:
      - 8200:8200
    environment:
      - output.elasticsearch.hosts=['http://elasticsearch:9200']
      - apm-server.host="0.0.0.0:8200"
      - apm-server.secret_token="xxVpmQB2HMzCL9PgBHVrnxjNXXw5J7bd79DFm6sjBJR5HPXDhcF8MSb3vv4bpg44"
      - setup.kibana.host="kibana:5601"
      - setup.template.enabled=true
      - logging.to_files=false
    depends_on:
      elasticsearch:
        condition: service_healthy
      kibana:
        condition: service_healthy
