Chochae Chatbot Engine V3 - On Premise Installation

Requirement

  • Any Linux Distribution (Recommended Debian, Ubuntu 22.04 or above)

  • At least 4 CPU core and 16 GB of memory.

  • docker and docker-compose installed.

Setup instructions

(1) Goto any working directory, and setup a project directory

$ mkdir proj
$ cd proj

(2) Add config.py

$ cat <<EOF > config.py
db_conn = "mongodb://admin:password@mongo:27017/admin"
channel_secret= ""
channel_access_token= ""
basic_id= ""
# This is page access token that you get from facebook developer console.
PAGE_ACCESS_TOKEN = ""
port = 8000
EOF

(3) Make db directory and chmod to 777 for allowing whole directory read and write permission.

$ mkdir db
$ sudo chmod 777 -R db

(4) Add docker-compose.yaml

$ cat <<EOF > docker-compose.yaml
version: '3.7'
services:
    chochae3_chatbot:
        # If you did not get the container path, please contact info@iapp.co.th
        image: <IAPP CHOCHAE3 CHATBOT CONTAINER PATH> 
        environment:
          - LANG=en_US.UTF-8
        volumes:
          - ./config.py:/usr/src/app/utils/config.py
        ports:
          - "8000:8000"
    mongo:
        image: mongo:4.4
        ports:
          - 27017:27017
        environment:
          - MONGO_INITDB_ROOT_USERNAME=admin
          - MONGO_INITDB_ROOT_PASSWORD=password
          - MONGO_INITDB_DATABASE=local
          - MONGO_INITDB_USERNAME=admin
          - MONGO_INITDB_PASSWORD=password
        volumes:
          - ./init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh
          - ./db:/data/db
EOF

(5) Start running container as a daemon state (Backend service) using docker-compose.

$ docker-compose up -d

(6) Verify the installation by viewing docker container list

$ docker ps -a
CONTAINER ID   IMAGE                                                      COMMAND                 CREATED        STATUS                PORTS                                                                  NAMES
71b0b015ba9b   gcr.io/iapp-gcr-public/chochae3-chatbot-engine:20230326   "python app.py"          2 minutes ago   Up 2 seconds          0.0.0.0:8000->8000/tcp, :::8000->8000/tcp                                  chatbot_chochae3_chatbot_1
2ee89b2c13ca   mongo:4.4                                                 "docker-entrypoint.s…"   2 minutes ago   Up 2 seconds          0.0.0.0:27017->27017/tcp, :::27017->27017/tcp                              chatbot_mongo_1

Last updated