1
0

docker-compose.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. services:
  2. libretranslate:
  3. container_name: libretranslate
  4. build:
  5. context: .
  6. dockerfile: ./docker/Dockerfile
  7. restart: unless-stopped
  8. ports:
  9. - "9013:5000"
  10. ## Uncomment this for logging in docker compose logs
  11. # tty: true
  12. healthcheck:
  13. test: ['CMD-SHELL', './venv/bin/python scripts/healthcheck.py']
  14. ## Uncomment above command and define your args if necessary
  15. # command: --ssl --ga-id MY-GA-ID --req-limit 100 --char-limit 500
  16. ## Uncomment this section and the libretranslate_api_keys volume if you want to backup your API keys
  17. # environment:
  18. # - LT_API_KEYS=true
  19. # - LT_API_KEYS_DB_PATH=/app/db/api_keys.db # Same result as `db/api_keys.db` or `./db/api_keys.db`
  20. ## Uncomment these vars and libretranslate_models volume to optimize loading time.
  21. # - LT_UPDATE_MODELS=true
  22. # - LT_LOAD_ONLY=en,fr
  23. volumes:
  24. - ./libretranslate_api_keys:/app/db
  25. #Keep the models in a docker volume, to avoid re-downloading on startup
  26. - ./libretranslate_models:/home/libretranslate/.local:rw
  27. networks:
  28. - asgard
  29. volumes:
  30. libretranslate_api_keys:
  31. libretranslate_models:
  32. networks:
  33. asgard:
  34. name: asgard
  35. external: true