Friday, 6 June 2025

elastci search health check on docker compose might cause time out

boost it up

 services:

  elasticsearch:

    image: docker.elastic.co/elasticsearch/elasticsearch:8.x

    healthcheck:

      test: ["CMD-SHELL", "curl -fs http://localhost:9200/ || exit 1"]

      # Probe every 60 seconds instead of 30

      interval: 1m

      # Wait up to 30 seconds for each probe

      timeout: 30s

      # Retry 10 times before marking unhealthy instead of 5

      retries: 10

      # Give ES up to 5 minutes to finish booting

      start_period: 5m

No comments:

Post a Comment