gpt_chat_bot/scripts/start-bot.sh
Dmitry Afanasyev d1ae7f2281
add question count table (#73)
* update admin url

* update log level

* add user question count table

* rename ChatGpt to ChatGptModels

* change user to root in ci tests

* add chatgpt_shared volume
2023-12-28 14:26:29 +03:00

28 lines
556 B
Bash

#! /bin/bash
set -e
if [ -f shared/${DB_NAME:-chatgpt.db} ]
then
alembic downgrade -1 && alembic upgrade "head"
else
alembic upgrade "head"
fi
echo "starting the bot"
if [[ "${START_WITH_WEBHOOK}" == "true" ]]
then
echo "Starting bot in webhook mode..."
gunicorn main:create_app \
--workers ${WORKERS_COUNT} \
--bind ${APP_HOST}:${APP_PORT} \
--worker-class uvicorn.workers.UvicornWorker \
--timeout 150 \
--max-requests 2000 \
--max-requests-jitter 400
else
echo "Starting bot in polling mode..."
python main.py
fi