Rasa-x Docker Compose installation with Spacy Model

Hi all, I followed the guide for installing Rasa-X running it within the docker container. I want to run a model that has spaCy with a specific model. When I run the Rasa-X I receive the following error:

rasa-production_1 | File “/opt/venv/lib/python3.8/site-packages/rasa/nlu/utils/spacy_utils.py”, line 62, in load_model raise InvalidModelError

rasa-production_1 | rasa.nlu.model.InvalidModelError: Please confirm that en_core_web_trf is an available spaCy model. You need to download one upfront. For example: python -m spacy download en_core_web_md

I added the model to the pipeline and requirements.txt. I guess I need to manually install it in the docker? If so, how should I do it? Should I run a command in the docker-compose.yml to pip install the model, should I login into the docker? What do you recommend?

@Federico can you share the config.yml file and docker and docker-compose file?

@nik202 I simply run the install script downloaded from

https://storage.googleapis.com/rasa-x-releases/0.42.3/install.sh

which, in turn, downloads this docker-compose

https://storage.googleapis.com/rasa-x-releases/0.42.3/docker-compose.ce.yml

and everything is inside /etc/rasa (by default). Digging deeper I see that Rasa recommends (quote) " If your model has a dependency that is not included in any of the tags (for example, a different spaCy language model), you can build a docker image that extends the rasa/rasa image." From here

Building a Rasa Assistant in Docker

I’m currently thinking about building my own rasa image using the spaCy model I need and use that in the docker compose above. Is this the right way to proceed? If so, I’m not sure how to build the docker image for Rasa using

https://github.com/RasaHQ/rasa/blob/2b943f9c7b4c6235feb035658a80a63b6a4736b0/docker/Dockerfile.full

In other words, whether to use the Makefile in the repo and modify the Dockerfile above or call the Docker command build directly. Any pointers on this (assuming it is the right way to proceed)?

Update: eventually I modified one of the Dockerfile to install the spaCy model I needed. For example, docker/Dockerfile.full. I then run

make build-docker

make build-docker-full

and replaced the newly created image in the docker-compose for rasax

Hi, @Federico, i’m facing the same problem, how did you solve it? What file did you modify, and where are them located?

@GiackV he already shared the solution :slight_smile: and even I shared you the same in your original post.