From 29deea61bff6e7eeebb50872c9569ebbc4cd4945 Mon Sep 17 00:00:00 2001 From: Sampo Turve Date: Tue, 13 Aug 2024 15:50:05 +0300 Subject: [PATCH] GH-420: Elasticsearch for DDEV - Use default ES configuration by ddev-elasticsearch - Use docker-compose.elasticsearch_extra.yaml to only override the image to use ES8 + install analysis-ukrainian and analysis-icu. --- .../elasticsearch/manifest.yaml | 9 ++++++ .ddev/docker-compose.elasticsearch.yaml | 28 +++++++++++++++++++ .ddev/docker-compose.elasticsearch_extra.yaml | 8 ++++++ .ddev/elasticsearch/config/elasticsearch8.yml | 15 ++++++++++ .../docker-compose.elasticsearch8.yaml | 6 ++++ 5 files changed, 66 insertions(+) create mode 100644 .ddev/addon-metadata/elasticsearch/manifest.yaml create mode 100644 .ddev/docker-compose.elasticsearch.yaml create mode 100644 .ddev/docker-compose.elasticsearch_extra.yaml create mode 100644 .ddev/elasticsearch/config/elasticsearch8.yml create mode 100644 .ddev/elasticsearch/docker-compose.elasticsearch8.yaml diff --git a/.ddev/addon-metadata/elasticsearch/manifest.yaml b/.ddev/addon-metadata/elasticsearch/manifest.yaml new file mode 100644 index 0000000..a01dbf3 --- /dev/null +++ b/.ddev/addon-metadata/elasticsearch/manifest.yaml @@ -0,0 +1,9 @@ +name: elasticsearch +repository: ddev/ddev-elasticsearch +version: v0.3.2 +install_date: "2024-08-13T10:51:11+03:00" +project_files: + - elasticsearch/ + - docker-compose.elasticsearch.yaml +global_files: [] +removal_actions: [] diff --git a/.ddev/docker-compose.elasticsearch.yaml b/.ddev/docker-compose.elasticsearch.yaml new file mode 100644 index 0000000..33192e9 --- /dev/null +++ b/.ddev/docker-compose.elasticsearch.yaml @@ -0,0 +1,28 @@ +#ddev-generated +services: + elasticsearch: + container_name: ddev-${DDEV_SITENAME}-elasticsearch + hostname: ${DDEV_SITENAME}-elasticsearch + image: elasticsearch:7.17.14 + expose: + - "9200" + - "9300" + environment: + - cluster.name=docker-cluster + - discovery.type=single-node + - bootstrap.memory_lock=true + - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + - VIRTUAL_HOST=$DDEV_HOSTNAME + - HTTP_EXPOSE=9200:9200 + - HTTPS_EXPOSE=9201:9200 + labels: + com.ddev.site-name: ${DDEV_SITENAME} + com.ddev.approot: $DDEV_APPROOT + volumes: + - elasticsearch:/usr/share/elasticsearch/data + - ".:/mnt/ddev_config" + healthcheck: + test: ["CMD-SHELL", "curl --fail -s elasticsearch:9200"] + +volumes: + elasticsearch: diff --git a/.ddev/docker-compose.elasticsearch_extra.yaml b/.ddev/docker-compose.elasticsearch_extra.yaml new file mode 100644 index 0000000..7f78be5 --- /dev/null +++ b/.ddev/docker-compose.elasticsearch_extra.yaml @@ -0,0 +1,8 @@ +# Overrides for default Elasticsearch configuration. +services: + elasticsearch: + image: elasticsearch:8.10.2 + volumes: + - ./elasticsearch/config/elasticsearch8.yml:/usr/share/elasticsearch/config/elasticsearch.yml + command: > + /bin/sh -c "./bin/elasticsearch-plugin install analysis-ukrainian analysis-icu; /usr/local/bin/docker-entrypoint.sh" diff --git a/.ddev/elasticsearch/config/elasticsearch8.yml b/.ddev/elasticsearch/config/elasticsearch8.yml new file mode 100644 index 0000000..3a612d3 --- /dev/null +++ b/.ddev/elasticsearch/config/elasticsearch8.yml @@ -0,0 +1,15 @@ +#ddev-generated +# This file contains the configuration settings for Elasticsearch 8. +# For more information, see https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html + +# https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#cluster-name +cluster.name: "docker-cluster" + +# https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#network.host +network.host: 0.0.0.0 + +# Disable security features +# https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#general-security-settings +xpack.security.enabled: false +xpack.security.autoconfiguration.enabled: false +xpack.security.enrollment.enabled: false diff --git a/.ddev/elasticsearch/docker-compose.elasticsearch8.yaml b/.ddev/elasticsearch/docker-compose.elasticsearch8.yaml new file mode 100644 index 0000000..1d81cae --- /dev/null +++ b/.ddev/elasticsearch/docker-compose.elasticsearch8.yaml @@ -0,0 +1,6 @@ +#ddev-generated +services: + elasticsearch: + image: elasticsearch:8.10.2 + volumes: + - ./elasticsearch/config/elasticsearch8.yml:/usr/share/elasticsearch/config/elasticsearch.yml