feat: systemd service file

This commit is contained in:
Piotr Dec 2026-04-07 22:51:51 +02:00
parent dfb4de6288
commit 8582daf4c0
Signed by: stawros
GPG key ID: 74B18A3F0F1E99C0

34
systemd/karl.service Normal file
View file

@ -0,0 +1,34 @@
[Unit]
Description=Karl
After=network.target
Wants=network.target
StartLimitBurst=3
StartLimitIntervalSec=60
[Service]
User=karl
WorkingDirectory=/home/karl/app
ExecStart=/home/karl/app/venv/bin/gunicorn \
-c /home/karl/app/gunicorn.conf.py \
app.main:app
# Graceful reload (sends SIGHUP)
ExecReload=/bin/kill -s HUP $MAINPID
# Restart on failure
Restart=on-failure
RestartSec=5s
# Security hardening
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ReadWritePaths=/var/log/karl /tmp
# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=karl
[Install]
WantedBy=multi-user.target