Files
pobsync/deploy/systemd/pobsync-web.service

20 lines
690 B
SYSTEMD
Raw Normal View History

[Unit]
Description=pobsync Django control panel
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=@POBSYNC_USER@
Group=@POBSYNC_GROUP@
WorkingDirectory=@POBSYNC_APP_DIR@
EnvironmentFile=@POBSYNC_ENV_FILE@
ExecStartPre=@POBSYNC_VENV_DIR@/bin/python manage.py migrate --noinput
ExecStartPre=@POBSYNC_VENV_DIR@/bin/python manage.py collectstatic --noinput --clear
ExecStart=/bin/sh -c 'exec @POBSYNC_VENV_DIR@/bin/gunicorn pobsync_server.wsgi:application --bind "${POBSYNC_WEB_BIND:-127.0.0.1:8010}" --workers "${POBSYNC_GUNICORN_WORKERS:-2}" --timeout "${POBSYNC_GUNICORN_TIMEOUT:-120}"'
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target