Finished server configuration with a bash script to start gunicorn monitored by supervisor

This commit is contained in:
Felipe Martín 2013-05-23 13:40:47 +02:00
parent df77cac478
commit fea572bd83
3 changed files with 18 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[program:gunicorn]
command = /home/app/virtualenv/bin/python2 /home/app/app/manage.py run_gunicorn --settings=herobrine.local_settings -w 2
directory = /home/app/app
command = /home/app/server.sh
directory = /home/app
user = app
autostart = true
autorestart = true

View File

@ -39,7 +39,10 @@ CONFIG_FILES = [
'%s/config/production/app.supervisor.conf' % GIT_DOWNLOAD_DIR,
'./conf/app.supervisor.conf'
),
(
'%s/config/production/server.sh' % GIT_DOWNLOAD_DIR,
'./server.sh'
),
]
FIXTURES = [

12
config/server/server.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
# CONFIG
WORKERS=2
SETTINGS="herobrine.local_settings"
# Get environment resources
source .bash_profile
source virtualenv/bin/activate
# Start
gunicorn_django app --settings=$SETTINGS -w $WORKERS