Skip to content

Instantly share code, notes, and snippets.

@alanbchristie
Created March 19, 2024 23:39
Show Gist options
  • Save alanbchristie/6965b86bb3b644d21f0642b5aae7bba0 to your computer and use it in GitHub Desktop.
Save alanbchristie/6965b86bb3b644d21f0642b5aae7bba0 to your computer and use it in GitHub Desktop.
LibreTranslate
Installed on a RPi 5 (libre-translate.local/192.168.0.6)
To create API keys enter the container: -
docker exec -it <container> bash
The use 'ltmanage' to list the keys: -
./venv/bin/ltmanage keys
And create new ones: -
./venv/bin/ltmanage keys add 240
Get the latest docker container image: -
docker pull libretranslate/libretranslate:latest
And a db volume: -
mkdir db
chmod a+w db
And modify the run.sh so it has the following docker run command,
which disables the Web UI, forces the use of API keys
and mounts the local db directory into the container
to ensure API keys are preserved between reboots: -
docker run -dti --restart unless-stopped
-e LT_DISABLE_WEB_UI=True
-e LT_API_KEYS=True
-e LT_REQUIRE_API_KEY_SECRET=True
-p $LT_PORT:$LT_PORT
-v ./db:/app/db
-v lt-local:/home/libretranslate/.local
libretranslate/libretranslate ${ARGS[@]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment