halkyon/deploy/compose.languagetool.yaml

48 lines
2.2 KiB
YAML
Raw Permalink Normal View History

# The LanguageTool sidecar (decided 2026-10-26, ADR 0024): LanguageTool's open-source
# server beside the instance, which checks spelling and grammar for Halkyon Learn (Check
# in the assistant's field, and underlines while writing). Switched on in .env:
#
# COMPOSE_FILE=compose.learn.yaml:compose.languagetool.yaml
#
# It has no site, unlike Jellyfin: LanguageTool has no sign-in of its own, so only the
# server reaches it, which checks who asks and how often, and keeps nothing. Its one
# folder on the server, ./languagetool/fasttext (the model it tells languages apart
# with, fetched at its first start), is owned by a user ID of its own, which no person,
# no other container and not the CI runner uses: processes of one user ID can read
# each other's environment and files. Setting it up: sidecars/README.md.
services:
languagetool:
# meyay/languagetool 6.8-14: LanguageTool 6.8 built from its tag (LanguageTool's own
# downloads end at 6.6), the version Halkyon Learn's checks are tried with. Its
# publisher removes earlier builds: 6.8-13, pinned before, was gone by 9 Nov 2026,
# so a host without it cached couldn't start the instance.
image: meyay/languagetool@sha256:80de71abb2d797511240c3b47e0b4d1ed855ada49c92c8d2ee152f9aa1725aec
restart: unless-stopped
user: "61081:61081"
read_only: true
tmpfs:
# The configuration it writes at each start, and the native libraries Java
# unpacks and loads.
- /tmp:exec,size=64m,uid=61081,gid=61081
environment:
# Java's heap: 1.2 GB resident with fastText beside it, five languages loaded.
JAVA_XMS: 256m
JAVA_XMX: 1g
volumes:
- ./languagetool/fasttext:/fasttext
# On `edge` alone, beside Caddy and the server's public API, never beside Postgres;
# no published port, and no site in Caddy.
networks:
- edge
mem_limit: 2g
# No log at all: LanguageTool's names each check's length and language only, but
# what is written must never be kept, and a failing rule could name its sentence.
# To look into a failure, switch to journald for a while.
logging:
driver: none
server:
environment:
# The instance checks writing here (ADR 0024).
LANGUAGETOOL_URL: http://languagetool:8081/