add systemd and improve env.template

This commit is contained in:
2025-01-18 18:48:43 +01:00
parent de15b67115
commit 2ae6d49b72
3 changed files with 81 additions and 9 deletions

View File

@ -0,0 +1,22 @@
[Unit]
Description=LocationHub
After=network.target systemd-networkd-wait-online.service mysqld.service
[Service]
Type=simple
User=locationhub
WorkingDirectory=/home/locationhub/git/LocationHub/server/
ExecStart=/usr/bin/npm run dev
Restart=on-failure
StandardOutput=append:/var/log/LocationHub.log
StandardError=append:/var/log/LocationHub.log
[Install]
WantedBy=multi-user.target
```
Activate Systemd Job
```
systemctl daemon-reload
systemctl enable locationhub.service
systemctl start locationhub.service
systemctl status locationhub.service