2021-08-19 23:12:42 +02:00
|
|
|
# ScoDoc 9 systemd service
|
|
|
|
# Flask based
|
|
|
|
# a priori on ne dépend plus de postgresql ? XXX
|
|
|
|
# inspiré par https://blog.miguelgrinberg.com/post/running-a-flask-application-as-a-service-with-systemd
|
2021-08-21 19:51:33 +02:00
|
|
|
#
|
|
|
|
# A copier dans /etc/systemd/system/scodoc9.service
|
|
|
|
# puis
|
|
|
|
# sudo systemctl daemon-reload
|
|
|
|
# sudo systemctl start scodoc9
|
|
|
|
#
|
2021-08-19 23:12:42 +02:00
|
|
|
[Unit]
|
|
|
|
Description=ScoDoc 9 service
|
|
|
|
After=network.target
|
|
|
|
#Requires={{postgresql}}
|
|
|
|
#PartOf={{postgresql}}
|
|
|
|
#StartLimitIntervalSec=0
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
User=scodoc
|
|
|
|
Group=scodoc
|
|
|
|
WorkingDirectory=/opt/scodoc
|
2021-08-21 19:51:33 +02:00
|
|
|
#Environment=FLASK_ENV=production
|
2021-09-08 00:13:41 +02:00
|
|
|
ExecStart=/opt/scodoc/venv/bin/gunicorn -b localhost:8000 -w 4 --timeout 600 scodoc:app
|
2021-08-19 23:12:42 +02:00
|
|
|
Restart=always
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|