Deployment
Run GSNOC in production with systemd and nginx.
Production Build
npm run build
The build output goes to .next/ (or out/ for static export).
systemd Service
Create /etc/systemd/system/gsnoc.service:
[Unit]
Description=GSNOC NOC Platform
After=network.target mysql.service
[Service]
Type=simple
User=gsnoc
WorkingDirectory=/opt/gsnoc
ExecStart=/usr/bin/node server.js
Restart=on-failure
RestartSec=5
Environment=NODE_ENV=production
EnvironmentFile=/opt/gsnoc/.env
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable --now gsnoc
nginx Reverse Proxy
server {
listen 80;
server_name gsnoc.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name gsnoc.example.com;
ssl_certificate /etc/letsencrypt/live/gsnoc.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/gsnoc.example.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Production Checklist
- Set
NODE_ENV=production - Use a strong
SESSION_SECRET(32+ random bytes) - Enable MySQL SSL if the DB is on a separate host
- Configure log rotation for GSNOC logs
- Set up automated MySQL backups
- Monitor with
systemctl status gsnocandjournalctl -u gsnoc -f