From 911c9d9bc341b6bee132359844dc022cc61e33e9 Mon Sep 17 00:00:00 2001 From: kenny Date: Sat, 31 Jan 2026 13:12:07 +0200 Subject: [PATCH] Added libretranslate + wonsership script --- libretranslate/correct_ownership.sh | 5 +++++ libretranslate/docker-compose.yml | 34 +++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 libretranslate/correct_ownership.sh create mode 100644 libretranslate/docker-compose.yml diff --git a/libretranslate/correct_ownership.sh b/libretranslate/correct_ownership.sh new file mode 100755 index 0000000..21ea1c4 --- /dev/null +++ b/libretranslate/correct_ownership.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + + +sudo chown -R 1000:1000 ./libretranslate_models +chmod -R u+rwX ./libretranslate_models diff --git a/libretranslate/docker-compose.yml b/libretranslate/docker-compose.yml new file mode 100644 index 0000000..3794aba --- /dev/null +++ b/libretranslate/docker-compose.yml @@ -0,0 +1,34 @@ +services: + libretranslate: + container_name: libretranslate + image: libretranslate/libretranslate:latest + ports: + - "5555:5000" + restart: unless-stopped + user: "1000:1000" + healthcheck: + test: ['CMD-SHELL', './venv/bin/python scripts/healthcheck.py'] + interval: 10s + timeout: 4s + retries: 4 + start_period: 5s + ## Uncomment this for logging in docker compose logs + tty: true + ## Uncomment above command and define your args if necessary + ## Refer to the documentation for more information: https://docs.libretranslate.com/guides/installation/#arguments + # command: --ssl --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 # Same result as `db/api_keys.db` or `./db/api_keys.db` + ## Uncomment these vars and libretranslate_models volume to optimize loading time. + - LT_UPDATE_MODELS=true + - LT_LOAD_ONLY=en,fr,ru,es,ro,de,ja,zh,pt,it,ko + 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: