The Rasa Stack (Core and NLU) are open source and many Rasa Platform users
have developed custom NLU components and Rasa Core Policies. This page
explains how to let your custom Rasa Core & NLU servers communicate with
Rasa Platform. We will show you how to run them as Docker containers, but this
is optional. You can skip Section 2 if you don’t want to use Docker.

Your custom version of Rasa NLU should launch an instance of the builtin
server class RasaNLU. We recommend that you define it in a script
called nlu_server.py. This should be located in your custom Rasa NLU
branch or directory, and can make use of any custom code you need.

The next step is to write a Dockerfile instructing Docker to
install any necessary dependencies and run the script when the container is
started. You can either extend the official Rasa NLU image or build your own
from scratch using the
offical Dockerfiles
as template.

You can now build your Docker image. The following command creates the image
and tags it as <YOUR_RASA_NLU_IMAGE>:

$ sudo docker build -t <YOUR_RASA_NLU_IMAGE> .

Note

This command requires your Dockerfile to be located in the root
directory of the Rasa NLU version you wish to install.

Rasa NLU and Core can both be run as standalone docker containers which can
be used on Rasa Platform instead of an official build. You have to make sure
docker-compose points to a Docker image of your custom version of Rasa
NLU and Core. To do this, edit or create docker-compose.override.yml,
and create entries for the nlu or core service (or both).
Here’s an example in which both core and nlu point to custom images:

Replace <YOUR_RASA_NLU_IMAGE> and <YOUR_RASA_CORE_IMAGE>
with the image names of your custom NLU and Core versions. These could either
be images that you’ve built locally on your server, or they could be
URLs pointing to your private Docker registry.

If your custom code runs as plain python code on another server, you will
have to modify your docker-compose.override.yml to make sure the
Platform does not run the default Core and NLU services, and instead
runs dummy images that do nothing but print a “Hello” message. Your
docker-compose.override.yml should contain the following:

In case your images point to a Docker registry, you need to pull them
before starting up the Platform. For example, if your NLU image is
located at my-private-docker-registry.com/my-custom-nlu:latest, and your
Core image at my-private-docker-registry.com/my-custom-core:latest,
the commands are