I'd like to run multiple spacy language models on various docker containers. I don't want the docker image to contain the line RUN python -m spacy download en_core_web_lg, as other processes might have different language models.
My question is: Is it possible to download multiple spacy language models onto local (i.e. en_core_web_lg, en_core_web_md, ...), and then load these models into the python-spacy environment when the docker container spawns?
This process might have the following steps:
- Spawn docker container and bind a volume "language_models/" to the container which contains a number of spacy models.
- Run some spacy command such as
python -m spacy download --local ./language_models/en_core_web_lgwhich points at the language model which you want the environment to have.
The hope is that, since the language model already exists on the shared volume, the download/import time is significantly reduced for each new container. Each container also would not have unnecessary language models on it, and the Docker image would not be specific to any language models at all.