feat(deploy): 添加开发环境 systemd 服务,改进部署文档

This commit is contained in:
2026-04-19 00:31:26 +08:00
parent 44aa62da49
commit 988828b984
4 changed files with 256 additions and 5 deletions

28
rust-backend-dev.service Normal file
View File

@@ -0,0 +1,28 @@
[Unit]
Description=Rust Backend Development Service
After=network.target postgresql.service
Wants=network.target
[Service]
Type=simple
User=root
Group=root
WorkingDirectory=/root/rust/rust_backend_dev
ExecStart=/root/rust/rust_backend_dev/rust-backend
Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal
EnvironmentFile=/root/rust/rust_backend_dev/.env
NoNewPrivileges=yes
PrivateTmp=yes
ProtectSystem=strict
ProtectHome=read-only
ReadWritePaths=/root/rust/rust_backend_dev
SyslogIdentifier=rust-backend-dev
[Install]
WantedBy=multi-user.target