services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:8.7.0 container_name: es-test ports: - 9200:9200 - 9300:9300 environment: - xpack.security.enabled=true - discovery.type=single-node - ELASTIC_PASSWORD=DkIedPPSCb healthcheck: test: ["CMD-SHELL", "curl --silent --fail -u elastic:DkIedPPSCb localhost:9200/_cluster/health || exit 1"] interval: 10s timeout: 30s retries: 3