Add actions.py for Rasax on Server With Domain (docker-compose)

Hello, I have tried to do the following steps in the RasaMasterclass tutorial #9 (https://www.youtube.com/watch?v=IUYdwy8HPVc) to add action:

1, sudo mkdir actions

2, sudo touch actions / __ init__.py

3, sudo touch actions / actions.py

4, sudo nano actions / actions.py> add code

5, sudo touch docker-compose.override.yml

6, sudo nano docker-compose.override.yml>

add code:

version: '3.4'
services:
  app:
    image: 'rasa / rasa-sdk: latest'
    volumes:
      - './actions:/app/actions'
    expose:
      - '5055'
    depends_on:
      - rasa-production

7,sudo docker-compose up -d

I then do the action test in Rasax, but I don’t get any response. This is the topic that Rasa doesn’t guide you on, does anyone have a solution? please!

Hi,

I believe that you need to copy your action folder from your RASA bot into the same folder as your docker-compose files. This is due to the volumes line, where the folder actions in your directory is mounted to the /app/actions of the docker. I think the tutorial should have made it clearer.

Let me know if you are still experiencing any issues. Always happy to help :slight_smile:

Thanks for the feedback, I copied the code into actions.py file on docker-compose like part 9 of Rasa Master Class but I didn’t see any action taking place. It seems the implementation of actions.py with Docker-Compose is out of date

Hi,

I just tried it out and it worked for my side. Did you docker-compose down and up it again?

Can you also post the logs of the app container here?

You can do this by using sudo docker logs <your foldername>_app_1

For mine, my folder name is rasa_x, to get the logs: sudo docker logs rasa_x_app_1

Here are the logs which shows that the action server is running correctly

2021-05-12 01:52:35 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
2021-05-12 01:52:35 INFO     rasa_sdk.executor  - Registered function for 'action_hello_world'.
2021-05-12 01:52:35 INFO     rasa_sdk.endpoint  - Action endpoint is up and running on http://0.0.0.0:5055

Hope it helps!

[Edit] I created a new thread just now https://forum.rasa.com/t/rasa-x-connecting-to-custom-action-server-using-docker-discussion-and-tutorial/43481 to guide new users to set up action server with RASA X and to gather some advice from the experts. Hope it helps!

Hi @trinhminhhieu are you able to solve this?