diff --git a/.env.template b/.env.template index 4f7df1d..e02a865 100644 --- a/.env.template +++ b/.env.template @@ -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 diff --git a/_deploy/tg_bot.service b/_deploy/tg_bot.service new file mode 100644 index 0000000..8bcece5 --- /dev/null +++ b/_deploy/tg_bot.service @@ -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 \ No newline at end of file