Trouble running Rasa X - non-default ports (docker-compose deployment)

Hey everyone! I’m having a lot of trouble trying to run Rasa X - probably I’m just making a silly mistake, hope someone here can point me to the right direction.

I’m successfully working with two containers, one running a Rasa server, another with actions.
Docker-compose and Dockerfile content for the project:

    build: ./rasa
      - "5000:5000" 
      - ./rasa:/rasa
    container_name: rasa
      - action_server
      - rasa-network

    build: ./rasaction
      - "5055:5055"
      - ./rasaction:/rasaction
    container_name: action_server
      - rasa-network

Part of the Dockerfile on rasa directory:

`RUN pip install rasa-x --extra-index-url
RUN pip install rasa[spacy]
RUN python -m spacy download pt_core_news_sm
RUN python -m spacy link pt_core_news_sm pt`

Shell in use to run server: #!/bin/sh rasa run -m /rasa/models --enable-api --endpoints /rasa/endpoints.yml --log-file out.log -p 5000

Inside the running Rasa server container (port 5000), trying to use ‘rasa x’ command doesn’t seem to work: ERR_CONNECTION_REFUSED. So I’ve tried to alter the ports on docker-compose, setting ports to ‘5005:5005’ and on command erasing the -p 5005 command, since it’s the server default value already. Inside the running container again, the ‘rasa x’ command returns another error (trying to use ‘rasa x --rasa-x-port 5001’ returns the same one)

Traceback (most recent call last): File “/usr/local/lib/python3.6/site-packages/sanic/”, line 745, in serve http_server = loop.run_until_complete(server_coroutine) File “uvloop/loop.pyx”, line 1417, in uvloop.loop.Loop.run_until_complete File “uvloop/loop.pyx”, line 1686, in create_server OSError: [Errno 98] error while attempting to bind on address (‘’, 5005): address already in use

On another try, I’ve altered on docker-compose ports to ‘5002:5002’ and on command ‘rasa run -m /rasa/models --enable-api --endpoints /rasa/endpoints.yml --log-file out.log -p 5001’. Inside the container this time when I try ‘rasa x’, it runs sucessfully. I’m able to train models and use it normally, but using curl afterwards to check the server returns either connection refused (5001) or recv failure (port 5002).

Since this is just the beggining of a really big project, and I’m soon setting up many other containers to work with Rasa, I woudn’t like to mess up the already working Rasa server, so I just left the ports how they were set up initially (5000), not trying to use Rasa X anymore. I would like, however, to be able to use it sometimes as well, since it’s an amazing improvement and would help a lot in the future. Hope someone can tell me where this is going wrong.

Thanks a lot in advance! :sweat_smile:

Hi @carla.lmeida,

have you already solved it or does the problem still persist?

Hey there @Tobias_Wochinger! Thank you for answering :relaxed: (and sorry for the delay, I just saw this message today!)

Unfortunately the problem still persists, do you have any idea what could be going wrong?

I think the problem is that you are running rasa x which starts both rasa-x and rasa in the container. However, rasa is in a separate container so you don’t need to run it in the rasa-x container. You are probably looking for the rasa x --production command which only runs the rasa x part. Have you already had a look on this deployment guide and the docker-compose.yml it uses?

hi , any solution for this ? as I am getting port already in use error for 5005 port since prod and worker both uses this port

any help would be appreciated

I resolved it by reverting back to ports : 5005 for both Pord and Worker , but the problem is that , I am running itself in a container so after reverting back I lost the ability to access the http api using port 5005