From 294c22c5e5dc99f6eb5782748d7f7c9bba5a59cd Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Fri, 11 Jan 2019 23:15:43 +0300 Subject: [PATCH] add requirements & fix supervisor config --- requirements.txt | 22 ++++++++++++++++++++++ supervisor.conf | 27 ++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f02dfd2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,22 @@ +amqp==2.3.2 +billiard==3.5.0.5 +celery==4.2.1 +certifi==2018.11.29 +chardet==3.0.4 +Django==2.1.5 +django-bootstrap4==0.0.7 +django-environ==0.4.5 +django-extensions==2.1.4 +django-picklefield==2.0 +idna==2.8 +kombu==4.2.2.post1 +psycopg2-binary==2.7.6.1 +pyTelegramBotAPI==3.6.6 +pytz==2018.9 +redis==3.0.1 +requests==2.21.0 +six==1.12.0 +urllib3==1.24.1 +uWSGI==2.0.17.1 +vine==1.2.0 +Werkzeug==0.14.1 diff --git a/supervisor.conf b/supervisor.conf index 09833d2..6b38a4c 100644 --- a/supervisor.conf +++ b/supervisor.conf @@ -1,4 +1,7 @@ -[program:bots] +[group:bots] +programs = bots_web,bots_celeryd,bots_worker + +[program:bots_web] user = http directory = /srv/apps/bots command = /srv/apps/bots/venv/bin/uwsgi --yaml /srv/apps/bots/uwsgi.yml @@ -7,3 +10,25 @@ autorestart = true stderr_logfile = /srv/apps/bots/logs/uwsgi.log stdout_logfile = /srv/apps/bots/logs/uwsgi.log stopsignal = INT + +[program:bots_celeryd] +user = http +directory = /srv/apps/bots +command=/srv/apps/bots/venv/bin/celery worker --app=config -l info +stdout_logfile=/srv/apps/bots/logs/celeryd.log +stderr_logfile=/srv/apps/bots/logs/celeryd.log +autostart=true +autorestart=true +startsecs=10 +stopwaitsecs=600 + +[program:bots_worker] +user = http +directory = /srv/apps/bots +command=/srv/apps/bots/venv/bin/python /srv/apps/bots/manage.py worker_loop +stdout_logfile=/srv/apps/bots/logs/worker.log +stderr_logfile=/srv/apps/bots/logs/worker.log +autostart=true +autorestart=true +startsecs=10 +stopwaitsecs=600