[Unit] Description=WXM real-time gateway (Socket.IO bridging Laravel via Redis) Documentation=file:/var/www/html/WXM/modules/Socket/README.md After=network.target redis-server.service Wants=redis-server.service [Service] Type=simple # Adjust User/Group to whoever owns the deploy (commonly www-data in production). User=www-data Group=www-data WorkingDirectory=/var/www/html/WXM/modules/Socket # Reads modules/Socket/.env via dotenv; no EnvironmentFile needed. ExecStart=/usr/bin/node dist/index.js # Restart on crash, keep it alive. Restart=always RestartSec=3 # Logs go to journald (LOG_FORMAT=json recommended in prod). StandardOutput=journal StandardError=journal SyslogIdentifier=wxm-socket # Hardening. NoNewPrivileges=true ProtectSystem=full ProtectHome=true PrivateTmp=true [Install] WantedBy=multi-user.target