36 lines
1.3 KiB
YAML
36 lines
1.3 KiB
YAML
services:
|
|
libretranslate:
|
|
container_name: libretranslate
|
|
image: libretranslate/libretranslate:latest
|
|
restart: unless-stopped
|
|
ports:
|
|
- 127.0.0.1:3011:5000
|
|
## Uncomment this for logging in docker compose logs
|
|
tty: true
|
|
healthcheck:
|
|
test: ['CMD-SHELL', './venv/bin/python scripts/healthcheck.py']
|
|
mem_limit: 2g
|
|
## Uncomment above command and define your args if necessary
|
|
command: --ssl --ga-id MY-GA-ID --req-limit 100 --char-limit 500
|
|
## Uncomment this section and the libretranslate_api_keys volume if you want to backup your API keys
|
|
environment:
|
|
- LT_API_KEYS=true
|
|
- LT_API_KEYS_DB_PATH=/app/db/api_keys.db
|
|
## Uncomment these vars and libretranslate_models volume to optimize loading time.
|
|
- LT_UPDATE_MODELS=true
|
|
- LT_LOAD_ONLY=en,it
|
|
- LT_CHAR_LIMIT=1200
|
|
volumes:
|
|
- libretranslate_api_keys:/app/db
|
|
# Keep the models in a docker volume, to avoid re-downloading on startup
|
|
- libretranslate_models:/home/libretranslate/.local:rw
|
|
|
|
volumes:
|
|
libretranslate_api_keys:
|
|
libretranslate_models:
|
|
|
|
# https://blog.gcn.sh/howtos/installing-libretranslate-using-docker-and-ubuntu
|
|
# creating the api key
|
|
# docker exec -it libretranslate bash
|
|
# let's create a key with permission to run 120 requests per minute.
|
|
# /app/venv/bin/ltmanage keys add 120 |