S
Supanote
Sign in Sign up

Systemd Production Service Unit for Node.js Application

plain (ini) 1 day ago · 34 lines · 11 views
1[Unit]
2Description=Node.js Production Application Service
3After=network.target postgresql.service
4Wants=postgresql.service
5
6[Service]
7Type=simple
8User=deploy
9Group=deploy
10WorkingDirectory=/var/www/app
11ExecStart=/usr/bin/node server.js
12Restart=always
13RestartSec=5s
15# Environment Variables
16Environment=NODE_ENV=production
17Environment=PORT=3000
18EnvironmentFile=/var/www/app/.env
20# Security Hardening & Sandboxing
21NoNewPrivileges=true
22ProtectSystem=full
23ProtectHome=true
24PrivateTmp=true
25LimitNOFILE=65535
27# Logging
28StandardOutput=journal
29StandardError=journal
30SyslogIdentifier=node-app
32[Install]
33WantedBy=multi-user.target

No replies yet

Every reply is a note. Start a discussion, ask a question, or attach a code snippet.

Share Note

Download SVG
Social Card Preview
Open on mobile
Point your phone camera to open this note directly

Report this note

Notification