diff --git a/docker-compose.yml b/docker-compose.yml index 9e583c3..6c903f0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,7 @@ services: - OLLAMA_URL=${OLLAMA_URL:-https://ai.binarygnome.com} - OLLAMA_MODEL=${OLLAMA_MODEL:-gemma4:latest} - OLLAMA_API_KEY=${OLLAMA_API_KEY:-} + - LANGUAGETOOL_URL=http://languagetool:8010/v2 extra_hosts: - "host-gateway:host-gateway" networks: @@ -22,6 +23,23 @@ services: retries: 10 start_period: 15s + languagetool: + image: erikvl87/languagetool + restart: unless-stopped + environment: + - Java_Xms=256m + - Java_Xmx=512m + # Add more languages (comma-separated) or remove this line to load all + - langsToLoad=en + networks: + - internal + healthcheck: + test: ["CMD-SHELL", "wget -qO- http://localhost:8010/v2/languages > /dev/null"] + interval: 10s + timeout: 5s + retries: 18 # LT takes ~30–60 s to start on first run + start_period: 90s + app: build: ./frontend restart: unless-stopped diff --git a/server/routes/lint.js b/server/routes/lint.js index 1a71d90..71bdf50 100644 --- a/server/routes/lint.js +++ b/server/routes/lint.js @@ -11,7 +11,6 @@ router.use(auth) router.post('/check', async (req, res) => { const { text, language = 'en-US' } = req.body || {} if (!text || typeof text !== 'string') return res.status(400).json({ error: 'text required' }) - if (text.length > 40000) return res.status(400).json({ error: 'text too long (max 40 000 chars)' }) try { const body = new URLSearchParams({ @@ -25,7 +24,7 @@ router.post('/check', async (req, res) => { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', Accept: 'application/json' }, body: body.toString(), - signal: AbortSignal.timeout(20000), + signal: AbortSignal.timeout(30000), }) if (!r.ok) {