feat: systemd service file
This commit is contained in:
parent
dfb4de6288
commit
8582daf4c0
1 changed files with 34 additions and 0 deletions
34
systemd/karl.service
Normal file
34
systemd/karl.service
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue