How to avoid to download all languages when docker restarts?

Hello,
I’ve installed last Libretranslate version using docker compose. This is my docker-compose.yml file:

version: "3.9"
services:
  libretranslate:
    container_name: LibreTranslate
    image: libretranslate/libretranslate:v1.5.2
    healthcheck:
      test: ['CMD-SHELL', './venv/bin/python scripts/healthcheck.py']
    mem_limit: 2g
    security_opt:
      - no-new-privileges:true
    ports:
      - 5000:5000
    #environment:
    #  LT_LOAD_ONLY: en,es,de
    restart: on-failure:5

If I set specific languages (see commented code) it is very fast to start up. Otherwise, I have to wait a long time when I restart the container.

Is there a way to locally map languages to prevent to download them each time?
Thanks.

Yes, map a volume to the container’s /home/libretranslate/.local directory (where models are stored).

(Example for docker run: LibreTranslate/run.sh at main · LibreTranslate/LibreTranslate · GitHub)

Hi @pierotofy,
I tried to map a volume in this way:

    volumes:
      - ./data/local:/home/libretranslate/.local/

but I have this error:

LibreTranslate | PermissionError: [Errno 13] Permission denied: ‘/home/libretranslate/.local/share’

Try using a named volume.

may be try this command ? libretranslate runs with UID 1032
chown 1032:1032 ./data/local