feat: add Spug auto-deployment scripts for fullstack project
This commit is contained in:
40
spug/hospital-backend.service
Normal file
40
spug/hospital-backend.service
Normal file
@@ -0,0 +1,40 @@
|
||||
[Unit]
|
||||
Description=Hospital Performance Backend Service
|
||||
Documentation=https://gitea.gentronhealth.com/chenqi/hospital_performance
|
||||
After=network.target postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=www-data
|
||||
Group=www-data
|
||||
|
||||
# 工作目录
|
||||
WorkingDirectory=/var/www/hospital-performance/backend
|
||||
|
||||
# 环境变量
|
||||
Environment="PATH=/var/www/hospital-performance/venv/bin"
|
||||
Environment="DATABASE_URL=postgresql+asyncpg://postgresql:Jchl1528@192.168.110.252:15432/hospital_performance"
|
||||
Environment="SECRET_KEY=your-secret-key-change-in-production"
|
||||
Environment="DEBUG=False"
|
||||
|
||||
# 启动命令
|
||||
ExecStart=/var/www/hospital-performance/venv/bin/uvicorn app.main:app \
|
||||
--host 0.0.0.0 \
|
||||
--port 8000 \
|
||||
--workers 4 \
|
||||
--access-log
|
||||
|
||||
# 重启策略
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
# 资源限制(可选)
|
||||
LimitNOFILE=65535
|
||||
|
||||
# 日志配置
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=hospital-backend
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user