write/docker-compose.yml
chris bdafd3f2c3 Self-host LanguageTool in Docker Compose
- Add erikvl87/languagetool service on the internal network
  (port 8010, English only by default — change langsToLoad to add more)
- 256 MB min / 512 MB max heap; healthcheck waits up to ~3 min for
  first startup while Java initialises
- Server LANGUAGETOOL_URL hardwired to http://languagetool:8010/v2 —
  no character limits, no rate limits, fully private
- Remove 40 000-char cap from lint route (not needed self-hosted)
- Bump fetch timeout to 30 s for cold-start requests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 21:43:43 -04:00

61 lines
1.6 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

services:
server:
build: ./server
restart: unless-stopped
volumes:
- ./server_data:/app/data
- ./server_uploads:/app/uploads
environment:
- JWT_SECRET=${JWT_SECRET:-change-me-in-production}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
- 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:
- internal
healthcheck:
test: ["CMD-SHELL", "node -e \"require('net').createConnection(3000).on('connect',()=>process.exit(0)).on('error',()=>process.exit(1))\""]
interval: 5s
timeout: 3s
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 ~3060 s to start on first run
start_period: 90s
app:
build: ./frontend
restart: unless-stopped
depends_on:
server:
condition: service_healthy
networks:
- internal
ports:
- "127.0.0.1:3080:80"
networks:
internal:
driver: bridge
volumes:
server_data:
server_uploads: