{"id":13596750,"url":"https://github.com/Erikvl87/docker-languagetool","last_synced_at":"2025-04-09T20:31:18.994Z","repository":{"id":35395755,"uuid":"178174076","full_name":"Erikvl87/docker-languagetool","owner":"Erikvl87","description":"Dockerfile for LanguageTool server - configurable","archived":false,"fork":false,"pushed_at":"2025-02-24T09:17:57.000Z","size":105,"stargazers_count":496,"open_issues_count":19,"forks_count":59,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-24T09:32:25.240Z","etag":null,"topics":["docker","dockerfile","languagetool","languagetool-server"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/erikvl87/languagetool","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Erikvl87.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-28T09:49:41.000Z","updated_at":"2025-02-24T09:17:55.000Z","dependencies_parsed_at":"2023-12-07T17:25:40.440Z","dependency_job_id":"4f624e87-d5b6-4cd0-bfe3-922912e37bff","html_url":"https://github.com/Erikvl87/docker-languagetool","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erikvl87%2Fdocker-languagetool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erikvl87%2Fdocker-languagetool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erikvl87%2Fdocker-languagetool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erikvl87%2Fdocker-languagetool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Erikvl87","download_url":"https://codeload.github.com/Erikvl87/docker-languagetool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248107318,"owners_count":21048899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","dockerfile","languagetool","languagetool-server"],"created_at":"2024-08-01T16:02:45.452Z","updated_at":"2025-04-09T20:31:18.986Z","avatar_url":"https://github.com/Erikvl87.png","language":"Shell","funding_links":[],"categories":["Dockerfile","Shell"],"sub_categories":[],"readme":"[![Build Status](https://github.com/Erikvl87/docker-languagetool/workflows/Build/badge.svg)](https://github.com/Erikvl87/docker-languagetool) [![Tests Status](https://github.com/Erikvl87/docker-languagetool/workflows/Tests/badge.svg)](https://github.com/Erikvl87/docker-languagetool) [![Docker Pulls](https://img.shields.io/docker/pulls/erikvl87/languagetool)](https://hub.docker.com/r/erikvl87/languagetool) [![Latest GitHub tag](https://img.shields.io/github/v/tag/Erikvl87/docker-languagetool?label=GitHub%20tag)](https://github.com/Erikvl87/docker-languagetool/releases)\r\n\r\n# Dockerfile for LanguageTool\r\nThis repository contains a Dockerfile to create a Docker image for [LanguageTool](https://github.com/languagetool-org/languagetool).\r\n\r\n\u003e [LanguageTool](https://www.languagetool.org/) is an Open Source proofreading software for English, French, German, Polish, Russian, and [more than 20 other languages](https://languagetool.org/languages/). It finds many errors that a simple spell checker cannot detect.\r\n\r\n# Setup\r\n\r\n## Setup using Docker Hub\r\n\r\n```sh\r\ndocker pull erikvl87/languagetool\r\ndocker run --rm -p 8010:8010 erikvl87/languagetool\r\n```\r\n\r\nThis will pull the `latest` tag from Docker Hub. Optionally, specify a [tag](https://hub.docker.com/r/erikvl87/languagetool/tags) to pin onto a fixed version. These versions are derived from the official LanguageTool releases. Updates to the Dockerfile for already published versions are released with a `-dockerupdate-{X}` postfix in the tag (where `{X}` is an incremental number).\r\n\r\n## Setup using the Dockerfile\r\nThis approach could be used when you plan to make changes to the `Dockerfile`.\r\n\r\n```sh\r\ngit clone https://github.com/Erikvl87/docker-languagetool.git --config core.autocrlf=input\r\ndocker build -t languagetool .\r\ndocker run --rm -it -p 8010:8010 languagetool\r\n```\r\n\r\n# Configuration\r\n\r\n## Java heap size\r\nLanguageTool will be started with a minimal heap size (`-Xms`) of `256m` and a maximum (`-Xmx`) of `512m`. You can overwrite these defaults by setting the [environment variables](https://docs.docker.com/reference/cli/docker/container/run/#env) `Java_Xms` and `Java_Xmx`.\r\n\r\nAn example startup configuration:\r\n\r\n```sh\r\ndocker run --rm -it -p 8010:8010 -e Java_Xms=512m -e Java_Xmx=2g erikvl87/languagetool\r\n```\r\n\r\n## LanguageTool HTTPServerConfig\r\nYou are able to use the [HTTPServerConfig](https://languagetool.org/development/api/org/languagetool/server/HTTPServerConfig.html) configuration options by prefixing the fields with `langtool_` and setting them as [environment variables](https://docs.docker.com/reference/cli/docker/container/run/#env).\r\n\r\nAn example startup configuration:\r\n\r\n```sh\r\ndocker run --rm -it -p 8010:8010 -e langtool_pipelinePrewarming=true -e Java_Xms=1g -e Java_Xmx=2g erikvl87/languagetool\r\n```\r\n\r\n## Overwrite logging configuration\r\nTo overwrite the [default LanguageTool logback.xml logging configuration](https://github.com/languagetool-org/languagetool/blob/master/languagetool-server/src/main/resources/logback.xml), create a new `logback.xml` file and mount it into the container.\r\n\r\nFor example, create the following `logback.xml` file:\r\n```xml\r\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\r\n\u003cconfiguration\u003e\r\n  \u003clogger name=\"org.languagetool\" level=\"ERROR\"/\u003e\r\n\u003c/configuration\u003e\r\n```\r\n\r\nAn example startup configuration:\r\n\r\n```sh\r\ndocker run --rm -it -p 8010:8010 -v /home/john/logback.xml:/LanguageTool/logback.xml erikvl87/languagetool\r\n```\r\n\r\n\r\n## Using n-gram datasets\r\n\u003e LanguageTool can make use of large n-gram data sets to detect errors with words that are often confused, like __their__ and __there__.\r\n\r\n*Source: [https://dev.languagetool.org/finding-errors-using-n-gram-data](https://dev.languagetool.org/finding-errors-using-n-gram-data)*\r\n\r\n[Download](http://languagetool.org/download/ngram-data/) the n-gram dataset(s) onto your local machine and unzip them into a local ngrams directory:\r\n\r\n```\r\nhome/\r\n├─ john/\r\n│  ├─ ngrams/\r\n│  │  ├─ en/\r\n│  │  │  ├─ 1grams/\r\n│  │  │  ├─ 2grams/\r\n│  │  │  ├─ 3grams/\r\n│  │  ├─ nl/\r\n│  │  │  ├─ 1grams/\r\n│  │  │  ├─ 2grams/\r\n│  │  │  ├─ 3grams/\r\n```\r\n\r\nMount the local ngrams directory to the `/ngrams` directory in the Docker container [using the `-v` configuration](https://docs.docker.com/engine/reference/commandline/container_run/#read-only) and set the `languageModel` configuration to the `/ngrams` folder.\r\n\r\nAn example startup configuration:\r\n\r\n```sh\r\ndocker run --rm -it -p 8010:8010 -e langtool_languageModel=/ngrams -v /home/john/ngrams:/ngrams:ro erikvl87/languagetool\r\n```\r\n\r\n## Improving the spell checker\r\n\r\n\u003e You can improve the spell checker without touching the dictionary. For single words (no spaces), you can add your words to one of these files:\r\n\u003e * `spelling.txt`: words that the spell checker will ignore and use to generate corrections if someone types a similar word\r\n\u003e * `ignore.txt`: words that the spell checker will ignore but not use to generate corrections\r\n\u003e * `prohibited.txt`: words that should be considered incorrect even though the spell checker would accept them\r\n\r\n*Source: [https://dev.languagetool.org/hunspell-support](https://dev.languagetool.org/hunspell-support)*\r\n\r\nThe following `Dockerfile` contains an example on how to add words to `spelling.txt`. It assumes you have your own list of words in `en_spelling_additions.txt` next to the `Dockerfile`.\r\n\r\n```dockerfile\r\nFROM erikvl87/languagetool\r\n\r\n# Improving the spell checker\r\n# http://wiki.languagetool.org/hunspell-support\r\nUSER root\r\nCOPY en_spelling_additions.txt en_spelling_additions.txt\r\nRUN  (echo; cat en_spelling_additions.txt) \u003e\u003e org/languagetool/resource/en/hunspell/spelling.txt\r\nUSER languagetool\r\n```\r\n\r\nYou can build \u0026 run the custom Dockerfile with the following two commands:\r\n\r\n```sh\r\ndocker build -t languagetool-custom .\r\ndocker run --rm -it -p 8010:8010 languagetool-custom\r\n```\r\n\r\nYou can add words to other languages by changing the `en` language tag in the target path. Note that for some languages, e.g. for `nl` the `spelling.txt` file is not in the `hunspell` folder: `org/languagetool/resource/nl/spelling/spelling.txt`.\r\n\r\n# Docker Compose\r\n\r\nThis image can also be used with [Docker Compose](https://docs.docker.com/compose/). An example [`docker-compose.yml`](docker-compose.yml) is located at the root of this project.\r\n\r\n# Usage\r\nBy default this image is configured to listen on port 8010 which deviates from the default port of LanguageTool 8081.\r\n\r\nAn example cURL request:\r\n\r\n```sh\r\ncurl --data \"language=en-US\u0026text=a simple test\" http://localhost:8010/v2/check\r\n```\r\n\r\nPlease refer to the official LanguageTool documentation for further usage instructions.\r\n\r\n# Known issues \u0026 workarounds\r\n\r\nIf you experience problems when connecting local server to the official Firefox extension, see [cors-workaround](cors-workaround/).\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FErikvl87%2Fdocker-languagetool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FErikvl87%2Fdocker-languagetool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FErikvl87%2Fdocker-languagetool/lists"}