How can I implement spacy in the official docker compose installation?

I have seen this question before in this forum but it seems to get ignored. I installed rasa using the official docker compose script, which comes with the default English model. The bot is German. I need some help with implementing a spacy model. So far I have I tried to customize the docker-compose.yml by replacing the rasa-full image with rasa-spacy-de. Then I tried to connect to the rasa container terminal and install the model there. Both didn’t work. Any ideas? image

1 Like

I dont want to sound impatient, but I have now been at it for 3 months trying to get something relatively simple done with rasa: a docker environment that runs a chatbot using a spacy model in rasa x production mode

I have posted in youtube comments, here in the forum and in the rasa discord, and not a single helpful suggestion …

1 Like

The solution I found:

  1. I pulled a German spacy docker image (Docker Hub) but really you can just use the base rasa/rasa image.
  2. Run the image:

docker run --user root -it -p 8080:8080 rasa/rasa:2.8.0 init

  1. Install the spacy model, for me it was:

pip install --default-timeout=1800 "https://github.com/explosion/spacy-models/releases/download/de_dep_news_trf-3.0.0/de_dep_news_trf-3.0.0-py3-none-any.whl"

  1. Commit the changes and push it to Dockerhub as your own public image docker push myusername/myrasaimg:latest

  2. Replace the rasa/rasa image in the docker-compose.yml that is created by the official rasa install script

example: replace this …

x-rasa-services: &default-rasa-service
  restart: always
  image: "myusername/myrasaimg:latest"