Skip to content

Instantly share code, notes, and snippets.

@vpack
Created June 15, 2015 14:07
Show Gist options
  • Save vpack/e59060cc9452184c440b to your computer and use it in GitHub Desktop.
Save vpack/e59060cc9452184c440b to your computer and use it in GitHub Desktop.
Gunicorn Config

Use Virtualenvironment wrapper.

Installation.

$ cat requirements.txt 
gunicorn
$ pip install -r requirements.txt

Sample Config: /etc/systemd/system/gunicorn.service

[Unit]
Description=gunicorn daemon
After=network.target

[Service]
User=centos
Group=centos
WorkingDirectory=/svpack/projects/gunicorn
ExecStart=/svpack/.virtualenvs/boto/bin/gunicorn --workers 3 --bind unix:/svpack/projects/gunicorn/mysock.sock wsgi

[Install]
WantedBy=multi-user.target

Service

systemctl start gunicorn
systemctl enable gunicorn
systemctl status gunicorn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment