diff --git a/README.md b/README.md index 0c8c833..fc7a55a 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,16 @@ To install the plugin, run the following command, changing the version in URL to bin/elasticsearch-plugin install https://github.com/EvidentSolutions/elasticsearch-analysis-raudikko/releases/download/v0.1.1/elasticsearch-analysis-raudikko-0.1.1-es7.16.3.zip ``` +### Docker +Building the plugin and running with docker +``` +./gradlew build --DelastisearchVersion=8.5.3 +cd etc +docker compose build --build-arg "ES_VERSION=8.5.3" +docker compose up +``` +Elasticsearch should be running and available at port 9200 + ### Verify installation After installing the plugin, you can quickly verify that it works by executing: diff --git a/etc/Dockerfile b/etc/Dockerfile new file mode 100644 index 0000000..a25cd41 --- /dev/null +++ b/etc/Dockerfile @@ -0,0 +1,8 @@ +ARG ES_VERSION=8.5.3 +FROM elasticsearch:${ES_VERSION} +# Needs to repeat the ARG here or it won't work +# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact +ARG ES_VERSION=8.5.3 +COPY /build/distributions/elasticsearch-analysis-raudikko-0.1-es${ES_VERSION}.zip /install/elasticsearch-analysis-raudikko.zip +RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install \ + --batch file:///install/elasticsearch-analysis-raudikko.zip \ diff --git a/etc/docker-compose.yml b/etc/docker-compose.yml new file mode 100644 index 0000000..408609b --- /dev/null +++ b/etc/docker-compose.yml @@ -0,0 +1,19 @@ +version: "3.9" +services: + elasticsearch: + build: + dockerfile: /etc/Dockerfile + context: ../ + # change version here or use + # docker compose build --arg "ES_VERSION=" + #args: + #ES_VERSION: 8.5.3 + ports: + - "9200:9200" + environment: + - discovery.type=single-node + - ES_JAVA_OPTS=-Xms1g -Xmx1g + - xpack.security.enabled=false + # NOTE on WSL needed to adjust following + # wsl -d docker-desktop + # sysctl -w vm.max_map_count=262144 diff --git a/etc/es-api-test.http b/etc/es-api-test.http new file mode 100644 index 0000000..b2c4ac9 --- /dev/null +++ b/etc/es-api-test.http @@ -0,0 +1,8 @@ +### check status +GET http://localhost:9200/_cluster/health?pretty + +### check version +GET http://localhost:9200 + +### show plugins +GET http://localhost:9200/_cat/plugins?v=true&s=component&h=component,version,description