deploy scripts

This commit is contained in:
2026-10-24 04:15:31 +02:00
parent 5c70c38523
commit d180eb3c90
3 changed files with 95 additions and 20 deletions
+7 -9
View File
@@ -4,10 +4,8 @@
# keeps the :7777 socket open, boots new workers on the new code, then
# gracefully stops the old ones - no downtime. See deploy/systemd/deploy.sh.
#
# Install:
# sudo cp deploy/systemd/polylan-submitter.service /etc/systemd/system/
# sudo systemctl daemon-reload
# sudo systemctl restart polylan-submitter # first switch from daphne needs a full restart
# Installed to /etc/systemd/system/ by deploy.sh: when this file changed it
# does daemon-reload + a full restart (HUP keeps the old ExecStart args).
[Unit]
Description=PolyLAN submitter (gunicorn + uvicorn workers)
@@ -15,10 +13,12 @@ After=network.target
[Service]
Type=simple
User=caddy
Group=caddy
Restart=always
RestartSec=1
User=root
WorkingDirectory=/home/caddy/polylan-submitter/polylan_submitter
# EnvironmentFile=/home/caddy/polylan-submitter/.env
# Relative to WorkingDirectory, loaded by settings.py via python-dotenv.
Environment="SETTINGS_ENV_FILE_LOCATION=polylan_submitter/.env"
# No --preload: with it, HUP re-forks from the already imported (old) code.
# --forwarded-allow-ips replaces daphne's --proxy-headers: trust
@@ -34,8 +34,6 @@ ExecReload=/bin/kill -s HUP $MAINPID
# SIGTERM to the master only, it then drains its workers (graceful-timeout).
KillMode=mixed
TimeoutStopSec=30
Restart=on-failure
RestartSec=2
[Install]
WantedBy=multi-user.target