To connect to GCP VM instance we need following two software installed in ou PC.
To download PUTTY click here
To download PUTTYGEN click here
- PUTTY
- PUTTYGEN
- Create the VM instance of Ubuntu over Compute Engine
- once the instance is created follow the steps shown in th youtube video til Timestamp 4.30
https://www.youtube.com/watch?v=fmh94mNQHQc
- Once you are connected to the instance, Follow the process as shown below to create the bot
Deploying Rasa Open Source Bot over Cloud using Docker with API enabled and using auth token for verification.
- Docker
- Docker Compose
-
Create the VM instance of Ubuntu over Compute Engine
-
once the instance is created login to the VM using SSH
-
Run the below commands and clone our Docker app:
-
sudo apt-get update
-
curl -fsSL https://get.docker.com -o get-docker.sh
-
sudo sh get-docker.sh
2) Install Docker-Compose
-
sudo curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
-
sudo chmod +x /usr/local/bin/docker-compose
-
docker-compose --version
-
-
cd pizza-bot
-
sudo apt-get update
-
sudo apt-get install software-properties-common
-
sudo add-apt-repository universe
-
sudo add-apt-repository ppa:certbot/certbot
-
sudo apt-get update
-
sudo apt-get install certbot
To get a certificate (you will need a domain name and email ready in this step):
-
sudo certbot certonly --standalone
Enter Email and choose correct options to install certbot
-
mkdir certs
-
sudo cp /etc/letsencrypt/live/yourdomainname/fullchain.pem ./certs
-
sudo cp /etc/letsencrypt/live/yourdomainname/privkey.pem ./certs
** Remember to change the yourdomainname to appropriate domain name name without http or https or www
-
docker-compose build
It will download the necessary docker images and will build the containers for us. Once the containers are ready , we can run the following command to make the containers up in running state:
-
sudo docker-compose up -d
-
Check whether the services are up and running using below command:
-
docker ps -a
-
Once you see all the services up and running, open the ip address of the machine in the browser and test the bot
Reclone the github with changes
shutdown docker with
-
docker-compose down
Re build the docker image with
-
docker-compose build
then just do
-
docker-compose restart
To connect using POSTMAN we will use Rest Channel and Do POST request
url :
https://yourwebsite.com/webhooks/rest/webhook
header : NONE
Body
{
"message":"tenios_start",
"sender" : "username"
}
Here is a screenshot showing the request POSTMAN
The Curl Request will be like this :
curl --location --request POST 'https://yourwebsite.com/webhooks/rest/webhook' \
--header 'Content-Type: application/json' \
--data-raw '{
"message":"tenios_start",
"sender" : "username"
}'