Skip to content

Instantly share code, notes, and snippets.

@yiidtw
Created November 13, 2018 06:34
Show Gist options
  • Save yiidtw/68cfcf973bd08379eb7d87b9880bf3bc to your computer and use it in GitHub Desktop.
Save yiidtw/68cfcf973bd08379eb7d87b9880bf3bc to your computer and use it in GitHub Desktop.
example of a systemd service file running a python + flask + gunicorn application
[Unit]
Description=Gunicorn instance to serve python-flask
After=network.target
[Service]
User=centos
Group=centos
WorkingDirectory=/home/centos/python-flask
Environment="PATH=/home/centos/miniconda2/envs/python-flask/bin"
ExecStart=/home/centos/miniconda2/envs/python-flask/bin/gunicorn --bind 0.0.0.0:8000 wsgi
# ExecStart=/home/centos/miniconda2/envs/python-flask/bin/gunicorn --workers 2 --bind unix:api.sock -m 007 wsgi
# https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-centos-7
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment