Skip to content

Instantly share code, notes, and snippets.

@NanoDano
Created July 20, 2020 03:20
Show Gist options
  • Save NanoDano/d954edffbdfe595e2ff73f8900c82d87 to your computer and use it in GitHub Desktop.
Save NanoDano/d954edffbdfe595e2ff73f8900c82d87 to your computer and use it in GitHub Desktop.
Systemd service file for a Gunicorn WSGI application
# /etc/systemd/system/gunicorn_app.service
# sudo python3 -m pip install gunicorn
[Unit]
Description=My WSGI app
After=network.target
[Service]
Type=simple
User=pi
WorkingDirectory=/var/www/my_wsgi_ap
ExecStart=/usr/local/bin/gunicorn app.wsgi -b 127.0.0.1:8001
Restart=always
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment