Added conf files for gunicorn and supervisord for production and staging.
[oweals/karmaworld.git] / confs / prod / supervisord.conf
diff --git a/confs/prod/supervisord.conf b/confs/prod/supervisord.conf
new file mode 100644 (file)
index 0000000..8fec260
--- /dev/null
@@ -0,0 +1,40 @@
+[supervisord]
+logfile = var/log/supervisord.log
+logfile_maxbytes = 10MB
+logfile_backups = 5
+loglevel = info
+pidfile = var/run/supervisord.pid
+
+[supervisorctl]
+serverurl = unix://var/run/supervisor.sock
+
+[unix_http_server]
+file = var/run/supervisor.sock
+chmod = 0777
+
+[rpcinterface:supervisor]
+supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
+
+[program:gunicorn]
+environment = DJANGO_SETTINGS_MODULE=karmaworld.settings.prod
+command = gunicorn -c confs/production/gunicorn.conf karmaworld.wsgi:application
+autostart = true
+autorestart = true
+redirect_stderr = true
+stopsignal = QUIT
+
+[program:celeryd]
+environment = DJANGO_SETTINGS_MODULE=karmaworld.settings.prod
+command = python manage.py celery worker --app=karmaworld.celery.config -l info
+autorestart = true
+redirect_stderr = true
+stdout_logfile = var/log/celeryd.log
+priority = 2
+
+[program:celerybeat]
+environment = DJANGO_SETTINGS_MODULE=karmaworld.settings.prod
+command = python manage.py celery beat --app=karmaworld.celery.config --pidfile=var/run/celerybeat.pid -s var/run/celerybeat-schedule -l info
+autorestart = true
+redirect_stderr = true
+stdout_logfile = var/log/celerybeat.log
+priority = 3