Docker Compose fails

Implementing rasa with docker and slack. In my compose file I have:

#################

version: 3.0:

services:

rasa:

container_name: rasa_server

image: rasa/rasa:latest-full

networks: ['rasa-network']

ports:

- "5005:5005"

volumes:
- "./rasa-app-data/models:/app/models"
- "./rasa-app-data/config:/app/config"
- "./rasa-app-data/project:/app/project"
- "./rasa-app-data/projects:/app/projects"
- "./rasa-app-data/logs:/app/logs"
- "./rasa-app-data/data:/app/data"

command:
- start
- -d
- ./model
- -c
- rest
- -u
- current/nlu
- --endpoints
- config/endpoints.yml

action_server:

container_name: action_server

image: rasa/rasa-sdk:latest
networks: ['rasa-network']
ports:
- "5055:5055"
volumes:
- "./rasa-app-data/actions:/app/actions"

networks: {rasa-network: {}}

I get the error-

rasa_server | usage: rasa [-h] [–version] rasa_server | {init,run,shell,train,interactive,test,visualize,data,x} … rasa_server | rasa: error: invalid choice: ‘start’ (choose from ‘init’, ‘run’, ‘shell’, ‘train’, ‘interactive’, ‘test’, ‘visualize’, ‘data’, ‘x’)

rasa_server exited with code 2

#############

The entrypoint is rasa – can you try run instead of start?

e.g. here the command is run

@erohmensing I would like to run the “shell” command to test my bot in the docker environment. However, when I use the command “shell” in my docker compose (at end of message), I get a permissions error. What’s the correct command to test out your bot with docker-compose? I would like to run with a connected compose file, because a command like docker run -it -v $(pwd):/app rasa/rasa shell only boots up rasa, and my action server is not detected (even when I boot up a container separately for port 5055:

rasa_1           | Warning: Output is not to a terminal (fd=1).
rasa_1           | Warning: Input is not to a terminal (fd=0).
rasa_1           | 2019-07-14 22:19:13 ERROR    asyncio  - Task exception was never retrieved
rasa_1           | future: <Task finished coro=<configure_app.<locals>.run_cmdline_io() done, defined at /usr/local/lib/python3.6/site-packages/r
asa/core/run.py:101> exception=PermissionError(1, 'Operation not permitted')>
rasa_1           | Traceback (most recent call last):
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/rasa/core/run.py", line 105, in run_cmdline_io
rasa_1           |     server_url=constants.DEFAULT_SERVER_FORMAT.format(port)
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/rasa/core/channels/console.py", line 123, in record_messages
rasa_1           |     text = get_cmd_input(button_question)
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/rasa/core/channels/console.py", line 71, in get_cmd_input
rasa_1           |     style=Style([("qmark", "#b373d6"), ("", "#b373d6")]),
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/questionary/question.py", line 45, in ask
rasa_1           |     return self.unsafe_ask(patch_stdout)
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/questionary/question.py", line 59, in unsafe_ask
rasa_1           |     return self.application.run()
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 709, in run
rasa_1           |     return run()
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 683, in run
rasa_1           |     return f.result()
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/eventloop/future.py", line 149, in result
rasa_1           |     raise self._exception
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/eventloop/coroutine.py", line 90, in step_next
rasa_1           |     new_f = coroutine.throw(exc)
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 658, in _run_async2
rasa_1           |     result = yield f
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/eventloop/coroutine.py", line 86, in step_next
rasa_1           |     new_f = coroutine.send(None)
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 598, in _run_async
rasa_1           |     with self.input.attach(read_from_input):
rasa_1           |   File "/usr/local/lib/python3.6/contextlib.py", line 81, in __enter__
rasa_1           |     return next(self.gen)
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/input/vt100.py", line 147, in _attached_input
rasa_1           |     loop.add_reader(fd, callback)
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/eventloop/posix.py", line 272, in add_reader
rasa_1           |     self.selector.register(fd)
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/eventloop/select.py", line 76, in register
rasa_1           |     sel.register(fd)
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/eventloop/select.py", line 131, in register
rasa_1           |     self._sel.register(fd, selectors.EVENT_READ, None)
rasa_1           |   File "/usr/local/lib/python3.6/selectors.py", line 412, in register
rasa_1           |     self._epoll.register(key.fd, epoll_events)
rasa_1           | PermissionError: [Errno 1] Operation not permitted

Here is my docker-compose.yml:

version: '3.0'
  
services:
  rasa:
    networks: ['rasa-network']
    image:/rasa:5005
    #build:
    #  context: .
    #  dockerfile: Dockerfile-rasa
    ports:
    - "5005:5005"
    volumes:
    - ./:/app
            #- "./models:/app/models"
            #- "./data:/app/data"
      #- "./rasa:/usr/local/lib/python3.6/site-packages/rasa"
    command: shell

  action_server:
    image: /crowdy:5055
    networks: ['rasa-network']
    ports:
    - "5055:5055"
    volumes:
    - "./actions:/app/actions"

  duckling:
    image: rasa/duckling:latest
    networks: ['rasa-network']
    ports:
    - "8000:8000"

networks: {rasa-network: {}}
1 Like

Hey @argideritzalpea, as stated in the docs, once you’re running a docker-compose with multiple containers, you’re entering through the docker-compose instead of the docker CLI and lose the ability to do connect to the command line of a single container with the it flag. Unfortunately I don’t think there’s a way around that – rasa shell is more for testing locally, and then once you push it to docker, you’d ideally be interacting with your bot via your (already locally tested) output channel.

1 Like