ids.alfacom.it/deployment/systemd/ids-backend.service
marco370 2f76875f2b Add systemd service for Node.js backend and update deployment scripts
Create `ids-backend.service` for the Node.js backend, modify `check_frontend.sh` to use systemd, and update `install_systemd_services.sh` to include the new service.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 4484d762-7461-4e0f-bf71-fa7a7609e794
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/6WuDAR4
2026-02-17 07:47:24 +00:00

33 lines
780 B
Desktop File

[Unit]
Description=IDS Node.js Backend (Express API + Frontend)
After=network.target postgresql-16.service
Wants=postgresql-16.service
[Service]
Type=simple
User=ids
Group=ids
WorkingDirectory=/opt/ids
EnvironmentFile=/opt/ids/.env
Environment=NODE_ENV=production
Environment=PORT=5000
Environment=PATH=/usr/local/bin:/usr/bin:/bin
ExecStartPre=/bin/bash -c 'test -f /opt/ids/dist/index.js || (echo "ERRORE: dist/index.js non trovato - eseguire npm run build" && exit 1)'
ExecStart=/usr/bin/env node dist/index.js
Restart=always
RestartSec=5
StartLimitInterval=300
StartLimitBurst=10
LimitNOFILE=65536
MemoryMax=1G
StandardOutput=append:/var/log/ids/backend.log
StandardError=append:/var/log/ids/backend.log
SyslogIdentifier=ids-backend
[Install]
WantedBy=multi-user.target