feat(deploy): openclaw-01 生产部署脚本、systemd 单元与部署文档
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
# 达道Task 生产服务(用户级 systemd,openclaw-01 上不需要 root)
|
||||
#
|
||||
# 安装:
|
||||
# cp deploy/prod/dadaotask-api.service ~/.config/systemd/user/
|
||||
# systemctl --user daemon-reload
|
||||
# systemctl --user enable --now dadaotask-api
|
||||
#
|
||||
# 两份 EnvironmentFile:
|
||||
# env.production —— 真实配置与口令(chmod 600,不进仓库)
|
||||
# env.build —— 由 deploy.sh 每次部署重写(BUILD_COMMIT / BUILD_TIME),供 /version 校验
|
||||
[Unit]
|
||||
Description=DadaoTask API (prod, gunicorn + uvicorn workers)
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/home/openclaw/app/dadaotask/backend
|
||||
EnvironmentFile=/home/openclaw/.config/dadaotask/env.production
|
||||
EnvironmentFile=/home/openclaw/.config/dadaotask/env.build
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
ExecStart=/home/openclaw/app/dadaotask/.venv/bin/gunicorn app.main:app \
|
||||
-k uvicorn.workers.UvicornWorker -w 2 \
|
||||
-b 0.0.0.0:8200 \
|
||||
--timeout 60 --graceful-timeout 30 --keep-alive 5 \
|
||||
--access-logfile - --error-logfile -
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
KillSignal=SIGTERM
|
||||
TimeoutStopSec=40
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
Reference in New Issue
Block a user