Gunicorn

From RHS Wiki
Jump to navigation Jump to search

Gunicorn service file[edit]

[Unit]
Description=Gunicorn Service
After=network.target

[Service]
User=ubuntu
Group=ubuntu
WorkingDirectory=/home/ubuntu/project
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=gunicorn
Restart=always
RestartSec=3
Environment=DJANGO_SETTINGS_MODULE=project.settings.prod
ExecStart=/home/rra/.virtualenvs/project/bin/gunicorn -w3 --timeout 300 --access-logfile /var/log/gunicorn/access.log --error-logfile /var/log/gunicorn/error.log --bind unix:/home/ubuntu/porject/project.sock project.wsgi

[Install]
WantedBy=multi-user.target

SSL[edit]

ExecStart=gunicorn -w 5 --certfile=/etc/ssl/certs/kaio.dyndns.org.crt --keyfile=/etc/ssl/private/www.example.com.key --access-logfile=/var/log/gunicorn/access.log --error-logfile=/var/log/gunicorn/error.log --bind=0.0.0.0:50538 project.wsgi