Files
ERP-core/deploy/systemd/erpcore.service
T
2026-09-17 11:25:33 +05:30

39 lines
1.1 KiB
Desktop File

# ERP-Core API — production (erp.hexdive.com).
#
# Install once (docs/40-DEPLOYMENT.md, "Active" A.2):
# cp deploy/systemd/erpcore.service /etc/systemd/system/
# systemctl daemon-reload && systemctl enable erpcore.service
# .gitea/workflows/ci-cd.yml stops it, replaces /home/erp/core/publish, then starts it again.
[Unit]
Description=ERP-Core API (production)
After=network-online.target postgresql-16.service
Wants=network-online.target
# Stop hammering the database if a release crash-loops.
StartLimitIntervalSec=300
StartLimitBurst=5
[Service]
Type=simple
User=erp
Group=erp
WorkingDirectory=/home/erp/core/publish
ExecStart=/home/erp/core/publish/ERPCore
# Secrets + settings (template: deploy/env/erpcore.env.example).
EnvironmentFile=/etc/erpcore/erpcore.env
Environment=DOTNET_CLI_TELEMETRY_OPTOUT=1
Restart=on-failure
RestartSec=5
TimeoutStopSec=30
# Shared 8 GB VPS: a runaway process must not take Gitea/Postgres down with it.
MemoryMax=768M
# Hardening. No ProtectHome: the app itself lives under /home/erp.
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=full
[Install]
WantedBy=multi-user.target