Deploy rasa application to dokku (docker)

Hello,

I would like to deploy my rasa application to Dokku (= heroku-like + docker).

For this, I added a Dockerfile into my application:

FROM rasa/rasa:latest-spacy-en

RUN rasa train --domain domain.yml --data data --out models

EXPOSE 5100

CMD [ "rasa", "run", "-m", "models", "--enable-api" ]

The rasa docker image is successfully retrieved but I got this error when executing the rasa train command:

Step 2/4 : RUN rasa train --data data
 ---> Running in f263870fd730
The config file 'config.yml' is missing mandatory parameters: 'policies'. Add missing parameters to config file and try again.
remote: The command '/bin/sh -c rasa train --data data' returned a non-zero code: 1

I tried to create an explicit folder for the application with the following Dockerfile:

FROM rasa/rasa:latest-spacy-en

RUN mkdir -p /usr/src/app

WORKDIR /usr/src/app

COPY . /usr/src/app

RUN rasa train --domain domain.yml --data data --out models

EXPOSE 5100

CMD [ "rasa", "run", "-m", "models", "--enable-api" ]

But I got this error:

Step 2/7 : RUN mkdir -p /usr/src/app
 ---> Running in f78470eb6d93
mkdir: cannot create directory ‘/usr/src/app’: Permission denied
remote: The command '/bin/sh -c mkdir -p /usr/src/app' returned a non-zero code: 1

Here is my config.yml file:

# Configuration for Rasa NLU.

# https://rasa.com/docs/rasa/nlu/components/
language: fr
pipeline: pretrained_embeddings_spacy

# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
  - name: MemoizationPolicy
  - name: KerasPolicy
  - name: MappingPolicy
  - name: FormPolicy

Any ideas?

Thanks very much for your help! Thierry

hi @templth - welcome to the forum! What I suspect is happening is that the user doesn’t have permission to create this folder, because we don’t run the container as root rasa/Dockerfile_pretrained_embeddings_spacy_en at master · RasaHQ/rasa · GitHub . You could either create a folder you do have permission for, or copy the Rasa dockerfile as a starting point and remove the USER line

Hi Alan,

Thanks very much for your answer! Using the Rasa dockerfil and adapting it a bit fixed the problem.

Thanks very much for your help! Thierry