initial commit

This commit is contained in:
2023-05-01 02:37:14 +03:00
commit 4a5dfbff3a
23 changed files with 3739 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
[Unit]
Description=Healthcheck bot
Wants=network-online.target
After=network-online.target
[Service]
Restart=always
WorkingDirectory=/opt/healthcheck_bot
ExecStart=/usr/local/bin/docker-compose -f /opt/healthcheck_bot/docker-compose.yml up
ExecStop=/usr/local/bin/docker-compose -f /opt/healthcheck_bot/docker-compose.yml down
[Install]
WantedBy=multi-user.target

17
scripts/start-bot.sh Normal file
View File

@@ -0,0 +1,17 @@
#! /bin/bash
echo "starting the bot"
if [[ "${START_WITH_WEBHOOK}" == "true" ]]
then
echo "Starting bot in webhook mode..."
gunicorn main:create_app \
--bind ${WEBAPP_HOST}:${WEBAPP_PORT} \
--worker-class aiohttp.GunicornWebWorker \
--timeout 150 \
--max-requests 2000 \
--max-requests-jitter 400
else
echo "Starting bot in polling mode..."
python main.py
fi