Skip to content

Instantly share code, notes, and snippets.

@alecklandgraf
Forked from jeremyjbowers/my_app.conf
Last active August 29, 2015 14:13
Show Gist options
  • Save alecklandgraf/71a0eb969ba2bb8972e6 to your computer and use it in GitHub Desktop.
Save alecklandgraf/71a0eb969ba2bb8972e6 to your computer and use it in GitHub Desktop.
description "uWSGI server for electris CMS"
start on runlevel [2345] # start on all runlevels.
stop on runlevel [!2345] # stop when shutting down.
respawn # respawn if job crashes or is stopped ungracefully.
env DEPLOYMENT_TARGET=production # set any environment variables you like here.
env DJANGO_SETTINGS_FILE=conf/settings.py # more environment variables if you like.
env PYTHONPATH=/home/ubuntu/apps/my_app:/home/ubuntu/.virtualenv/my_app
script # execute this block as a script
/usr/local/bin/uwsgi \ # path to the uwsgi binary
--virtualenv /home/ubuntu/.virtualenv/my_app \ # use a virtualenv
--chdir /home/ubuntu/apps/my_app \ # change to the directory of this application.
--file wsgi.py \ # the location of your wsgi file.
--touch-reload /home/ubuntu/apps/my_app/wsgi.py \ # file to touch-to-reload the application.
--callable app \ # are you using flask or some such? you might need a callable.
--logto /var/log/uwsgi.log \ # write to a log. make sure this exists or bad things happen.
--die-on-term \ # if the process is terminated, kill anything left over.
-p 1 \ # one process. you'll want 8-12 of these in production, possibly more.
-s :9000 # listen to the network socket 9000.
end script # end the script block.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment