Dockerizing my rasa chatbot application that has botfront

@mangesh

Please find the steps as per our discussion:

For Wordpress:

  1. For creating a docker image for Wordpress site for deployment purpose only; running on localhost 8000 Quick Wordpress Setup With Docker - YouTube
  2. Deploying rasa on Wordpress site please follow this link DEPLOY RASA CHATBOT TO WORDPRESS WEBSITE | WORDPRESS | INNOVATE YOURSELF - YouTube

For Docker Environment:

  1. Create the Dockerhub ID from https://hub.docker.com

  2. Create a Docker image for action server by the name Dockerfile (blue logo), if you have any requirements, please make a requirement.txt file in the same folder with all the packages in it.

Snippet code:

FROM rasa/rasa-sdk:2.7.0
WORKDIR /app
COPY requirement.txt requirement.txt
USER root
RUN pip install -r requirement.txt
EXPOSE 5055
USER 1001

Note: If you did not require the requirement.txt file at the moment please commented

  1. Dockerfile for Rasa; create outside the actions folder where other related files by the name Dockerfile (blue logo)

Snippet code:

FROM rasa/rasa:2.7.1
WORKDIR  '/app'
COPY . /app
USER root

RUN  rasa train 

VOLUME /app/models


CMD [ "run","-m","/app/models","--enable-api","--cors","*","--debug" ,"--endpoints", "endpoints.yml", "--log-file", "out.log", "--debug"]

EXPOSE 5005
  1. Create the docker-compose.yml file same as you created the above file outside the actions folder by the name docker-compose.yml (pink logo)

Snippet code:

version: '3'
services:
    rasa:
      container_name: "rasa_server"
      user: root
      build: 
        context:  .
      volumes:
      - "./:/app"
      ports: 
        - "5005:5005"
    action_server:
      container_name: "action_server"
      build: 
        context: actions
      volumes:
        - ./actions:/app/actions
        - ./data:/app/data
      ports:
        - 5055:5055

Note: Update in endpoints.yml

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

RUN the docker compose

  1. docker-compose up --build or after the build docker-compose up -d please see all the docker related commands.

  2. To check the container running or not docker ps or docker ps -a or docker-compose ps etc

  3. Copy a container from docker to localhost; run the command from terminal (should be in project folder)

docker cp <container ID or name>:"/app" "."

  1. Inspect the rasa server or action server as per need to see the content

docker exec -u root -t -i actions_server /bin/bash

Note: You will be able to run and execute all this whist if you are working on Window, Mac Or Ubuntu. If you have any issue whilst using this solution please mention me :wink:

This is my first ever so long post for any suggestion or solution with such a detail information. I hope it will solve your issue. Good Luck! Bro! Have fun :slight_smile:

7 Likes
Rasa docker-compose problem
Running Rasa with docker-compose
When i run my code using "rasa shell" my code works fine even custom action also works....but as i run docker-compose up my custom action not working showing this error
Unable to change port for action server while launching it throught docker
Integration on telegram
When i run my code using "rasa shell" my code works fine even custom action also works....but as i run docker-compose up my custom action not working showing this error
Rasa deployement : Cannot find ruamel.yaml on docker compose
How to deploy RASA Open Source using docker
When i run my code using "rasa shell" my code works fine even custom action also works....but as i run docker-compose up my custom action not working showing this error
Docker Error: Cannot connect to host action_server:5055 ssl:default [Temporary failure in name resolution]
I have a two dockerfiles for rasa server and action server. Do I need another one for the python package selenium?
Rasa chatbot behaves weirdly on docker, works perfectly on local
Rasa action server and duckling not running via docker compose
Issue running Rasa Open Source on Google Cloud Run: Could not load model due to [Errno 39] Directory not empty
Rasa Docker build is taken more time
Run rasa server directly, not from a source environment?
Unable to run rasa docker image from docker compose
Permission denied when using custom docker-compose
Rasa deployment - docker-compose method
Deploying Rasa using docker compose in Azure App services
Nltk resource not found
Getting error while dockerizing the rasa project
Action Server Docker-Compose Connection refused
Error unable to connect action server in docker
Error unable to connect action server in docker
Error unable to connect action server in docker
Failed to load ABCMeta from model storage. Resource 'train_DIETClassifier5' doesn't exist