[Unit]
Description=Dangerous Pi Frontend Service
Documentation=https://github.com/grizmin/dangerous-pi
After=network.target dangerous-pi.service
Wants=dangerous-pi.service

[Service]
Type=simple
User=dt
Group=dt
WorkingDirectory=/opt/dangerous-pi/app/frontend
Environment="NODE_ENV=production"
Environment="PORT=3000"
ExecStart=/usr/bin/node node_modules/@remix-run/serve/dist/cli.js build/server/index.js

# Restart policy
Restart=always
RestartSec=5
StartLimitBurst=5
StartLimitInterval=60

# Resource limits (lighter than backend)
MemoryMax=256M
CPUQuota=50%

# Graceful shutdown
TimeoutStopSec=10
KillMode=mixed
KillSignal=SIGTERM

[Install]
WantedBy=multi-user.target
