+ systemd service for TG bot

* Cleanup in .env
This commit is contained in:
Phil Zhitnikov 2024-04-28 03:28:13 +04:00
parent cfb75bad34
commit 1ea70513b0
2 changed files with 18 additions and 2 deletions

View File

@ -1,11 +1,12 @@
APP_HOME=/var/www/poizonstore-stage
APP_HOME="/var/www/poizonstore-stage"
# === Keys ===
# Django
SECRET_KEY=""
ALLOWED_HOSTS=.crm-poizonstore.ru,127.0.0.1,localhost,45.84.227.72
ALLOWED_HOSTS=".crm-poizonstore.ru,127.0.0.1,localhost,45.84.227.72"
# Telegram bot
TG_BOT_BIN="/var/www/poizonstore-stage/env/bin/python run_tg_bot.py"
TG_BOT_TOKEN=""
# External API settings

15
_deploy/tg_bot.service Normal file
View File

@ -0,0 +1,15 @@
[Unit]
Description=PoizonStore Telegram bot service
After=network.target
[Service]
Type=simple
User=poizon
Group=poizon
EnvironmentFile=/var/www/poizonstore-stage/.env
WorkingDirectory=/var/www/poizonstore-stage
ExecStart=/bin/sh -c '${TG_BOT_BIN}'
Restart=always
[Install]
WantedBy=multi-user.target