Skip to content

Instantly share code, notes, and snippets.

@muhozi
Last active November 13, 2018 09:54
Show Gist options
  • Save muhozi/b792579a07e319d0852990e187b3686d to your computer and use it in GitHub Desktop.
Save muhozi/b792579a07e319d0852990e187b3686d to your computer and use it in GitHub Desktop.
Creating a service on linux to run python application
[Unit]
Description=Gunicorn service to run your_application
After=network.target

[Service]
User=user
Group=www-data
WorkingDirectory=/home/user/apps/python/your_application
Environment="PATH=/home/user/apps/python/your_application/env/bin"
ExecStart=/home/user/apps/python/your_application/env/bin/gunicorn --workers 3 --bind unix:your_application.sock -m 007 app:app

[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment