diff --git a/config/production/app.supervisor.conf b/config/production/app.supervisor.conf new file mode 100644 index 0000000..915bf0c --- /dev/null +++ b/config/production/app.supervisor.conf @@ -0,0 +1,8 @@ +[program:gunicorn] +command = /home/app/virtualenv/bin/python /home/app/app/manage.py run_gunicorn -w 4 -k gevent +directory = /home/app/app +user = app +autostart = true +autorestart = true +stdout_logfile = /var/log/supervisor/gunicorn.log +stderr_logfile = /var/log/supervisor/gunicorn_err.log diff --git a/config/production/install.sh b/config/production/install.sh index e655b00..49cadc0 100644 --- a/config/production/install.sh +++ b/config/production/install.sh @@ -25,6 +25,8 @@ pacman -S git --noconfirm echo "=> Installing supervisor" pacman -S supervisor --noconfirm +systemctl start supervisord +systemctl enable supervisord echo "=> Installing nodejs and dependencies" pacman -S nodejs --noconfirm @@ -45,3 +47,5 @@ su - app -c "echo 'source .environment' > .bash_profile" echo "[REMEMBER!]" echo " - Create ssh keypair for the app user." echo " - Configure sudo to let app user execute the maintenance scripts." +echo " - Configure supervisor to include the app configuration." +echo " - Configure nginx to include the app configuration."