35 lines
806 B
Plaintext
35 lines
806 B
Plaintext
|
|
; hxops_supervisord.conf
|
|
; 放置于 /etc/supervisor/conf.d/hxops.conf
|
|
|
|
[program:hxops-backend]
|
|
; 启动命令:使用 Gunicorn 启动 Flask 应用
|
|
command=/opt/hxops/backend/venv/bin/gunicorn -c /opt/hxops/backend/deploy/gunicorn_config.py "app:create_app('production')"
|
|
|
|
; 工作目录
|
|
directory=/opt/hxops/backend
|
|
|
|
; 启动用户
|
|
user=root
|
|
|
|
; 自动启动
|
|
autostart=true
|
|
autorestart=true
|
|
|
|
; 启动重试次数
|
|
startretries=3
|
|
|
|
; 停止信号
|
|
stopsignal=QUIT
|
|
|
|
; 日志配置
|
|
stdout_logfile=/var/log/hxops/backend.log
|
|
stdout_logfile_maxbytes=50MB
|
|
stdout_logfile_backups=10
|
|
stderr_logfile=/var/log/hxops/backend_err.log
|
|
stderr_logfile_maxbytes=50MB
|
|
stderr_logfile_backups=10
|
|
|
|
; 环境变量
|
|
environment=FLASK_APP=run.py,FLASK_ENV=production,DATABASE_URL="postgresql://hxops:password@localhost/hxops_prod"
|