Rasa deployment - docker-compose method


I have a doubt regarding deploying rasa open-source. I have rasa and rasa action server. I’m trying to understand the docker-compose deployment Why should I consider rasa server and rasa action server as two different containers? Can I not run them as different services in the same container? I get that I won’t be able to scale these two separately. But I’m going to use the action server only when I use the rasa server.

@Juste could you please help me with this?

Hi @lis. It is a very interesting question, let me try to explain to you why we need different containers to run rasa server and rasa action server.

As you are aware the rasa server is running on port 5005 and the rasa action server is running on 5055 ( you can expose any mention port in your docker file or docker-compose file).

Docker is an open source containerization platform. It enables developers to package applications into containers —standardized executable components combining application source code with the operating system (OS) libraries and dependencies required to run that code in any environment.

It is generally recommended that you separate areas of concern by using one service per container . That service may fork into multiple processes. The container’s main process is responsible for managing all processes that it starts. Further, Isolation: By placing each process in a separate container, you gain the benefits of isolating the process so that it can’t interfere with others. Easier to scale : When a container consists of just one single process, it is easier to scale the application by creating more instances of the container.

If you are using the custom action then you required a action server container else you required only rasa server.

For Rasa open source deployment on docker, you can ref this thread: Dockerizing my rasa chatbot application that has botfront - #11 by nik202

I hope this will give you better understanding and solve your issue. Goodd Luck!

HI @nik202 , thanks for the reply. I came across this documention - Run multiple services in a container | Docker Documentation So I’m wondering if I can do the same for running rasa server and rasa action server. It;s still doable right? Although separating them into different containers is recommended.

@lis Right, well honestly I have not applied such a complex scenario but maybe that will be beneficial if we have some inter-dependent process. But, I have never seen such a scenario in the case of rasa over the whole internet. You can even ref the rasa official GitHub page and the docker file. I personally go by the easy process which can be easily maintained and scaled as we have a lot of codes and syntax for the rasa and rasa action server. But, you can experiment sky is the limit. If you need any further help please message me. Thanks.

Alright, thank you very much Nimit! Keeping this thread open so that I can get more insights from others

P.S: @Juste hoping to hear from you as well :smile:

@lis Sure no worries, as you got the solution or satisfaction in deployment using docker-compose do please close this thread as a solution as this topic is highly searchable on forum. Good Luck!

Also adding @ChrisRahme to this thread. Hoping to get some insights on this :smile:

1 Like

Generally better to use one service per container as mentioned above. No advantage in merging them into one container. Some specific examples where two containers makes things easier:

  • you can update rasa to a new version using images created and maintained by rasa without touching your actions image. if you merge it into one dockerfile you are taking on a maintenance task every time rasa updates.
  • you can update your actions without reloading rasa. You can fix bugs or add functionality without having to restart rasa and reload the models (which can take a lot of time).
  • the logs are separate. it is useful to look at action logs to debug your code. this will be harder if you have rasa and action logs all mixed up together.
1 Like

Completely agreed with Simon :slight_smile: