Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker files for easier development setup #7

Merged
merged 2 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions etc/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
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 \
19 changes: 19 additions & 0 deletions etc/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: "3.9"
services:
elasticsearch:
build:
dockerfile: /etc/Dockerfile
context: ../
# change version here or use
# docker compose build --build-arg "ES_VERSION=<custom_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
12 changes: 11 additions & 1 deletion etc/test-analyzer.http
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
### test analyzer
GET localhost:9200/_analyze
Content-Type: application/json; charset=UTF-8

{
"tokenizer" : "finnish",
"filter" : ["raudikko"],
"filter" : [{"type": "raudikko"}],
"text" : "Testataan raudikon analyysiä tällä tavalla yksinkertaisesti."
}

### 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