esdiag 0.16.4

Elastic Stack diagnostic collector and processor
# This compose file runs a minimal Elastic Stack with a security-disabled
# Elasticsearch, Kibana and Elastic Stack Diagnostics
#
# Without security enabled, there is no Kibana encryption, which prevents
# storing API keys for external services, like LLM providers. So features
# that depend on LLM or user authentication will not be available.
#
# Only use this for running esdiag on a local machine!
#
# Ensure you've allocated your container runtime virtual machine at least 8 GB
# of memory and as many CPU cores as you can spare for fast ingest performance.
# Diagnostics with over 100k shards or 100 nodes may require more memory.

name: esdiag
services:
  esdiag-webui:
    container_name: esdiag
    image: ${ESDIAG_IMAGE_TAG:-esdiag:latest}
    depends_on:
      esdiag-elasticsearch:
        condition: service_healthy
      esdiag-kibana:
        condition: service_healthy
    environment:
      ESDIAG_OUTPUT_URL: http://esdiag-elasticsearch:9200
      ESDIAG_KIBANA_URL: ${ESDIAG_KIBANA_URL}/s/${ESDIAG_KIBANA_SPACE}
      LOG_LEVEL: info
    command: ["serve"]
    networks:
      - net
    ports:
      - 2501:2501

  esdiag-elasticsearch:
    container_name: esdiag-elasticsearch
    image: ${ELASTIC_CONTAINER_REGISTRY}/elasticsearch/elasticsearch:${ELASTIC_VERSION}
    environment:
      - cluster.name=esdiag-cluster
      - node.name=esdiag-node
      - discovery.type=single-node
      - xpack.security.enabled=false
      - xpack.security.http.ssl.enabled=false
      - xpack.ml.use_auto_machine_memory_percent=true
      - ES_JAVA_OPTS=-Xms${ELASTICSEARCH_HEAP_INIT} -Xmx${ELASTICSEARCH_HEAP_MAX}
      # Workaround for MacOS 15.2 on M4: https://github.com/elastic/elasticsearch/issues/118583 and https://bugs.openjdk.org/browse/JDK-8345296
      - "_JAVA_OPTIONS=-XX:UseSVE=0"
    ulimits:
      # Remove ulimits for LXC: https://github.com/elastic/start-local/issues/27
      # Set to maximum for rootless Docker: https://github.com/elastic/start-local/issues/66
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data:/usr/share/elasticsearch/data
    networks:
      - net
    ports:
      - 9200:9200
    healthcheck:
      test:
        [
          "CMD-SHELL",
          "curl --output /dev/null --silent --head --fail http://esdiag-elasticsearch:9200",
        ]
      interval: 10s
      timeout: 10s
      retries: 30

  esdiag-kibana:
    container_name: esdiag-kibana
    image: ${ELASTIC_CONTAINER_REGISTRY}/kibana/kibana:${ELASTIC_VERSION}
    depends_on:
      esdiag-elasticsearch:
        condition: service_healthy
    environment:
      - SERVER_NAME=kibana
      - ELASTICSEARCH_HOSTS=http://esdiag-elasticsearch:9200
    volumes:
      - data:/usr/share/kibana/data
    networks:
      - net
    ports:
      - 5601:5601
    healthcheck:
      test:
        [
          "CMD-SHELL",
          "curl -s -I http://esdiag-kibana:5601 | grep -q 'HTTP/1.1 302 Found'",
        ]
      interval: 10s
      timeout: 10s
      retries: 30

volumes:
  data:
    driver: local

networks:
  net:
    driver: bridge