Docker for Rasa


I have built my bot with NLU and Core and use the GUI from I also read this nice blog:

My bot looks just like that.

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import logging

from rasa_core.agent import Agent
from rasa_core.channels.console import ConsoleInputChannel
from rasa_core.interpreter import RegexInterpreter
from rasa_core.policies.keras_policy import KerasPolicy
from rasa_core.policies.memoization import MemoizationPolicy
from rasa_core.interpreter import RasaNLUInterpreter

from bot_server_channel import BotServerInputChannel

logger = logging.getLogger(__name__)

def train_dialogue(domain_file = 'domain.yml',
                    model_path = './models/dialogue',
                    training_data_file = './data/'):
    agent = Agent(domain_file, policies = [MemoizationPolicy(),KerasPolicy()])#MemoizationPolicy(),
                max_history = 3,
                epochs = 300,
                batch_size = 15,
                validation_split = 0.0,
                augmentation_factor = 0)
    return agent
def run_bot(serve_forever=True):
    interpreter = RasaNLUInterpreter('./nlu')
    agent = Agent.load('./models/dialogue', interpreter = interpreter)

    channel = BotServerInputChannel(agent)

if __name__ == '__main__':

I am a docker newbie and so it seems simple to start to just docker this and let the GUI outside? Would I just just docker this complete code as a python code? What would I have to do with the GUI then. In the GUI I have to give the host where NLU is listening to. So I just give this port inside the dockerfile?


I managed to docker my bot. But now I am confused about the ports.

I run the docker with:

docker run -p 4000:4000 mybot

In my docker toolbox the message comes that server started at 5002:

INFO:root:Started http server on port 5002
2018-08-29 18:39:50+0000 [-] Log opened.
2018-08-29 18:39:50+0000 [-] Site starting on 5002
2018-08-29 18:39:50+0000 [-] Starting factory <twisted.web.server.Site object at 0x7faaa3ac50b8>

Then I tried with the IP of the docker toolbox in my browser with

But connection is refused.

What I have forget to think about?

Do I have to give a port in my docker file? My file looks simple like that:

FROM rasa_core
COPY agents /app
CMD ["python", "./"]

And this rasa_core file just installs rasa_core, rasa_nlu.

add EXPOSE portNumber to your Dockerfile

Previous working example (now broken due to Rasa Core updates) below:

Hi, would you be able to disclose how you figure out how to run your rasa worker and activity worker on a worker? I’m attempting to run it on Google App Engine, so far I figured out how to run the rasa worker accurately and speak with the bot without drawing in custom activities. The activity worker anyway I can’t arrive at it and just get a 502 awful door mistake. I’m utilizing separate dockerfiles for each, however I don’t have a clue for what reason doesn’t work.

order pcb