Rasa 2.0: shell + action server with docker?

Hi all. I want to use both rasa shell and action server, with each running as docker container instances. However I’m stumped at how to get it to work. Any help appreciated. Thanks.

I’m starting the containers with the following commands:

docker run -it -v ${PWD}:/app -v ${PWD}/.config:/.config -p 5005:5005 rasa/rasa:2.0.0-full shell --debug --endpoints endpoints.yml

docker run -it -v ${PWD}:/app -v ${PWD}/.config:/.config -p 5055:5055 rasa/rasa:2.0.0-full run actions --debug --cors "*"

endpoints.yml reads as follows:

action_endpoint:
  url: "http://localhost:5055/webhook"

Shell works fine without custom actions, and I can separately test the action server container instance using curl. However: the shell container can’t connect to the action container when it tries to run my custom action, reporting the following error:

Failed to run custom action 'action_estimate_life_expectancy'. Couldn't connect to the server at 'http://localhost:5055/webhook'. Is the server running?

I tried starting them both using docker-compose with the docker-compose.yml file below. They both start, but the rasa-bot container reports:

WARNING: your terminal doesn't support cursor position requests (CPR).

Then doesn’t show any bot prompts or echo any inputs (not sure if it’s reading them or not). I’m running in powershell on windows 10.

I don’t mind whether the solution uses docker-compose or not at this stage; just want to get things running. Thanks.

docker-compose.yml:

version: '3.0'

services:
  rasa:
    container_name: rasa-bot
    image: rasa/rasa:2.0.0-full
    stdin_open: true # docker run -i
    tty: true        # docker run -t
    networks: ['rasa-network']
    ports:
      - "5005:5005"
    volumes:
      - "./:/app"
      - "./.config:/.config"
    command:
      - shell
      - --debug
      - --endpoints
      - endpoints.yml
      - --cors
      - "*"
    depends_on:
      - action_server

  action_server:
    container_name: rasa-action-server
    image: rasa/rasa:2.0.0-full
    networks: ['rasa-network']
    ports:
    - "5055:5055"
    volumes:
    - "./actions:/app/actions"
    - "./.config:/.config"
    command:
      - run
      - actions
      - --cors
      - "*"

networks: {rasa-network: {}}

Hello all. Answering my own question in case it’s useful to others. I didn’t find a way to get the shell working with docker-compose but found another solution instead. This project provides a simple, free, web front end for interacting with bots. So I changed to using the REST server endpoint for the bot container, and used the web ui to interact with it. It’s just a simple html file with an embedded js script; so it just opens like any other local file in the browser. No need to host it on a web server.

Revised docker-compose file as follows:

version: '3.0'

services:
  rasa:
    container_name: rasa-rest-server
    image: rasa/rasa:2.0.0-full
    networks: ['rasa-network']
    ports:
      - "5005:5005"
    volumes:
      - "./:/app"
      - "./.config:/.config"
    command:
      - run
      - --debug
      - --enable-api
      - --endpoints
      - endpoints.yml
      - --cors
      - "*"
    depends_on:
      - action_server

  action_server:
    container_name: rasa-action-server
    image: rasa/rasa:2.0.0-full
    networks: ['rasa-network']
    ports:
    - "5055:5055"
    volumes:
    - "./actions:/app/actions"
    - "./.config:/.config"
    command:
      - run
      - actions
      - --cors
      - "*"

networks: {rasa-network: {}}

I also updated endpoints.yml as follows:

action_endpoint:
  url: http://action_server:5055/webhook

In case it’s not obvious: the action_server name in the enpoint url has to be the same as the corresponding action server container entry in docker-compose.yml.

A nice side effect of this approach is that the conversation is cleanly separated from debug information.