[Unit]
Description=Backup Manager for YunoHost (__INSTANCE_NAME__)
After=network.target

[Service]
Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=__INSTALL_DIR__
ExecStart=__INSTALL_DIR__/venv/bin/gunicorn \
    --bind 127.0.0.1:__PORT__ \
    --workers 1 \
    --timeout 300 \
    --log-level info \
    app:app

Restart=always
RestartSec=10

Environment="BACKUPMANAGER_CONFIG=__INSTALL_DIR__/config.py"
StandardOutput=append:__DATA_DIR__/logs/backupmanager.log
StandardError=append:__DATA_DIR__/logs/backupmanager.log

[Install]
WantedBy=multi-user.target
