59 lines
1.2 KiB
Desktop File
59 lines
1.2 KiB
Desktop File
[Unit]
|
|
Description=Sistema de ADAN - Frontend Web
|
|
Documentation=https://github.com/tuorganizacion/adan
|
|
After=network.target adan-api.service
|
|
Wants=adan-api.service
|
|
|
|
[Service]
|
|
Type=exec
|
|
User=root
|
|
Group=root
|
|
WorkingDirectory=/opt/adan/frontend
|
|
|
|
# Cargar variables de entorno
|
|
EnvironmentFile=/opt/adan/.env
|
|
|
|
# Comando de inicio usando 'serve' para servir archivos estaticos
|
|
# Opcion 1: Usando serve (recomendado para SPA React/Vue)
|
|
ExecStart=/usr/bin/serve \
|
|
-s dist \
|
|
-l 3000 \
|
|
--no-clipboard \
|
|
--single
|
|
|
|
# Opcion 2: Si usas Next.js en modo standalone
|
|
# ExecStart=/usr/bin/node /opt/adan/frontend/.next/standalone/server.js
|
|
|
|
# Opcion 3: Si prefieres usar Node directamente
|
|
# ExecStart=/usr/bin/npx serve -s dist -l 3000
|
|
|
|
# Reinicio automatico
|
|
Restart=always
|
|
RestartSec=5
|
|
|
|
# Timeouts
|
|
TimeoutStartSec=30
|
|
TimeoutStopSec=30
|
|
|
|
# Variables de entorno adicionales
|
|
Environment=NODE_ENV=production
|
|
Environment=PORT=3000
|
|
|
|
# Limites
|
|
LimitNOFILE=65535
|
|
|
|
# Seguridad
|
|
NoNewPrivileges=true
|
|
PrivateTmp=true
|
|
ProtectSystem=strict
|
|
ProtectHome=true
|
|
ReadWritePaths=/opt/adan
|
|
|
|
# Logging
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
SyslogIdentifier=adan-web
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|