4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

鬼滅の刃のAIチャットボットを作成したのでインターネットに公開してみる

Posted at

AI研究の為、会話ができるチャットボットを作ってみました。
また、試しにインターネットに公開してみますが負荷対策は一切していないのですぐにダウンするかもです。。。(;^ω^)
あと、ボットの頭はかなり悪いです。。。<(_ _)>

鬼滅の刃AIチャットボット
https://character-bot.herokuapp.com/s/kimetsu

■ローカル環境でチャットボットを作成

ディレクトリの準備

適当なディレクトリを用意して、その配下に移動
botpressのデータを格納するディレクトリ作成します
mkdir botpress_data

ローカル環境用にdocker-compose.ymlを作成

version: "3.8"

services:
    ##  チャットボットアプリ(botpress)
    chatbot:
        image: botpress/server:v12_21_0
        ##  コンテナ名を明示的に指定する
        container_name: character-bot
        environment:
            TZ: Asia/Tokyo
        volumes:   ##  ホストディレクトリ:コンテナディレクトリ
            - ./botpress_data:/botpress/data
        ##  4000番ポートを3000番ポートにつなぐ
        ports:
            - '4000:3000'

コンテナ起動

docker-compose up -d

ローカルのBotpressにアクセス

http://localhost:4000/
ログイン画面が表示されます

チャットボットを作成

チャットボットのデータがbotpress_dataディレクトリに保存されていきます

■インターネットにチャットボットを公開

Herokuアカウント作成

公開用のURLをセット

./botpress_data/global/botpress.config.json

"externalUrl": "https://character-bot.herokuapp.com/",

Heroku CLIインストール

https://devcenter.heroku.com/ja/articles/heroku-cli## download-and-install

Dockerfileを作成

FROM botpress/server:v12_21_0
COPY ./botpress_data /botpress/data
WORKDIR /botpress
CMD ["./bp"]

アプリケーション名をセット

APP_NAME="character-bot"

herokuにログイン

heroku login --interactive

herokuにアプリの領域を作成

heroku create ${APP_NAME}

herokuのコンテナレジストリにログイン

heroku container:login

Dockerfileをビルドしてpushする

heroku container:push web --app ${APP_NAME}

heroku上のアプリにアクセスする

heroku open --app ${APP_NAME}

herokuのログをtailfする

heroku logs --tail

■その他

heroku環境を削除する

heroku apps:destroy --app ${APP_NAME} --confirm ${APP_NAME}
4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?