Created
March 27, 2017 22:07
-
-
Save imdadahad/01d9f364ca9e690cd9f500edcaa2c018 to your computer and use it in GitHub Desktop.
An upstart systemd service for running Flask with gunicorn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Gunicorn instance to serve a flask api | |
After=network.target | |
[Service] | |
User=<user> | |
Group=www-data | |
WorkingDirectory=/home/<user>/flask_api | |
EnvironmentFile=/home/<user>/flask_api/.env # Specify app environment variables | |
Environment="PATH=/home/<user>/flask_api/venv/bin" # Ensure venv is setup | |
ExecStart=/home/<user>/flask_api/venv/bin/gunicorn --workers 1 --bind unix:flask_api.sock -m 007 wsgi:app | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment