aboutsummaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
authorChristian Segundo2022-04-10 12:07:27 +0200
committerGitHub2022-04-10 12:07:27 +0200
commit2fe33cbcb6a05e45d990fa1e21ac7ff42f2bc603 (patch)
tree2bdbf1c5e7cf336a95cf97309434ebd2cd000e71 /readme.md
parent73279ea16cfc28856302ac7ecdfe28026507f060 (diff)
parentfe4774d97c2c6faeddd8414829d7fe443d4837aa (diff)
downloadlanguagetool-2fe33cbcb6a05e45d990fa1e21ac7ff42f2bc603.tar.gz
Merge pull request #2 from someone-stole-my-name/feature/httpserveroptions
Add support for HTTPServerConfig options
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md60
1 files changed, 39 insertions, 21 deletions
diff --git a/readme.md b/readme.md
index 039a512..6789ef7 100644
--- a/readme.md
+++ b/readme.md
@@ -20,42 +20,60 @@ The Server is running on port 8010, this port should exposed.
[...]
docker run --rm -p 8010:8010 ghcr.io/someone-stole-my-name/docker-languagetool
-Or you run it in background via `-d` option.
+Route information can be found at https://languagetool.org/http-api/swagger-ui/#/default, an easy route to test that it's running is `/v2/languages`.
-Run with minimum rights and RAM limit
+## Configuration
- docker run --name languagetool \
- --cap-drop=ALL \
- --user=65534:65534 \
- --read-only \
- --mount type=bind,src=/tmp/languagetool/tmp,dst=/tmp \
- -p 127.0.0.1:8010:8010 \
- --memory 412m --memory-swap 500m \
- -e JAVAOPTIONS="-Xmx382M" \
- ghcr.io/someone-stole-my-name/docker-languagetool:latest
+### Java heap size
+You can set any Java related option using the `JAVAOPTIONS` environment variable.
-Route information can be found at https://languagetool.org/http-api/swagger-ui/#/default, an easy route to test that it's running is `/v2/languages`.
+ docker run --rm -it -p 8010:8010 -e JAVAOPTIONS="-Xmx382M" ghcr.io/someone-stole-my-name/docker-languagetool:latest
+
+### HTTPServerConfig
+
+Any environment variable prefixed with `LT_` is interpreted as an [HTTPServerConfig] option.
-## ngram support
+ docker run --rm -it -p 8010:8010 -p 9301:9301 \
+ -e LT_prometheusMonitoring=true \
+ ghcr.io/someone-stole-my-name/docker-languagetool:latest
+ [...]
+
+ curl -s localhost:9301 | grep -v '^\s*$\|^\s*\#' (k8s-pro)
+ languagetool_check_matches_total{language="en",mode="ALL",} 1.0
+ languagetool_threadpool_queue_size{pool="lt-server-thread",} 0.0
+ [...]
-To support [ngrams] you need an additional volume or directory mounted to the
-`/ngrams` directory. For that add a `-v` to the `docker run` command.
+### n-gram dataset support
+
+To support [ngrams] you need an additional volume or directory mounted to the `/ngrams` directory.
docker run ... -v /foo:/ngrams ...
-[ngrams]: http://wiki.languagetool.org/finding-errors-using-n-gram-data
-### Manual
+### Automatic download
-Download English ngrams with the commands:
+This image can take care of the initial download of any ngram supported language as well as updates.
+Mount a directory or volume to `/ngrams` and use the `NGRAM_LANGUAGES` environment variable to pass a comma separated string with languages:
+
+ docker run ... -v /path/to/ngrams:/ngrams -e NGRAM_LANGUAGES="en,es" ...
+
+### Manual download
+
+Download and unzip any language with the commands:
mkdir ngrams
wget https://languagetool.org/download/ngram-data/ngrams-en-YYYYMMDD.zip
(cd ngrams && unzip ../ngrams-en-YYYYMMDD.zip)
rm -f ngrams-en-YYYYMMDD.zip
-### Automatically
+It is important that the directory structure ends up looking like:
-Mount a directory or volume to `/ngrams` and use the `NGRAM_LANGUAGES` variable to pass a comma separated string with languages:
+ ngrams/
+ en/
+ ...
+ es/
+ ...
- docker run ... -v /path/to/ngrams:/ngrams -e NGRAM_LANGUAGES="en,es" ...
+
+[ngrams]: http://wiki.languagetool.org/finding-errors-using-n-gram-data
+[HTTPServerConfig]: https://languagetool.org/development/api/org/languagetool/server/HTTPServerConfig.html