api-server/deploy/zhixi-nest-api.service
wangdl 24ceb1353e
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 47s
fix: remove ProtectSystem/ReadWritePaths from systemd units
ProtectSystem=strict requires /run/systemd/unit-root paths to exist
which fails on production. Worker only needs network access (Redis/MySQL).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-19 21:26:47 +08:00

31 lines
574 B
Desktop File

[Unit]
Description=zhixi NestJS API Server
After=network.target mysql.service redis.service
Wants=mysql.service redis.service
[Service]
Type=simple
User=ubuntu
Group=ubuntu
WorkingDirectory=/opt/zhixi/api-server
ExecStart=/usr/bin/node dist/src/main.js
Restart=always
RestartSec=5
TimeoutStopSec=30
# Environment
Environment=NODE_ENV=production
Environment=PORT=3000
EnvironmentFile=/opt/zhixi/env/.env.production
# Security
NoNewPrivileges=yes
# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=zhixi-nest-api
[Install]
WantedBy=multi-user.target