1
0
mirror of https://github.com/LibreTranslate/LibreTranslate.git synced 2024-09-29 08:00:18 +02:00

Merge pull request #580 from jmlord/main

ltmanage in bin
This commit is contained in:
Piero Toffanin 2024-01-24 21:54:05 -05:00 committed by GitHub
commit b7a273dd28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 3 deletions

View File

@ -9,15 +9,24 @@ services:
restart: unless-stopped restart: unless-stopped
ports: ports:
- "5000:5000" - "5000:5000"
## Uncomment this for logging in docker compose logs
# tty: true
healthcheck: healthcheck:
test: ['CMD-SHELL', './venv/bin/python scripts/healthcheck.py'] test: ['CMD-SHELL', './venv/bin/python scripts/healthcheck.py']
## Uncomment above command and define your args if necessary ## Uncomment above command and define your args if necessary
# command: --ssl --ga-id MY-GA-ID --req-limit 100 --char-limit 500 # command: --ssl --ga-id MY-GA-ID --req-limit 100 --char-limit 500
## Uncomment this section and the `volumes` section if you want to backup your API keys ## Uncomment this section and the libretranslate_api_keys volume if you want to backup your API keys
# environment: # 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` # - 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
# volumes: # volumes:
# - libretranslate_api_keys:/app/db/api_keys.db # - 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: # volumes:
# libretranslate_api_keys: # libretranslate_api_keys:
# libretranslate_models:

View File

@ -30,6 +30,8 @@ USER libretranslate
COPY --from=builder --chown=1032:1032 /app /app COPY --from=builder --chown=1032:1032 /app /app
WORKDIR /app WORKDIR /app
COPY --from=builder --chown=1032:1032 /app/venv/bin/ltmanage /usr/bin/
RUN if [ "$with_models" = "true" ]; then \ RUN if [ "$with_models" = "true" ]; then \
# initialize the language models # initialize the language models
if [ ! -z "$models" ]; then \ if [ ! -z "$models" ]; then \