# systemd 服务单元示例 # 安装: sudo cp deploy/kefu.service /etc/systemd/system/ # sudo systemctl daemon-reload # sudo systemctl enable --now kefu [Unit] Description=Douyin Kefu Auto-Reply System After=network.target [Service] Type=simple User=www Group=www WorkingDirectory=/www/wwwroot/douyin/backend Environment=KEFU_HOST=0.0.0.0 Environment=KEFU_PORT=8000 Environment=KEFU_SERVE_WEB=true Environment=PLAYWRIGHT_BROWSERS_PATH=/www/wwwroot/douyin/playwright-browsers EnvironmentFile=-/www/wwwroot/douyin/.env ExecStart=/www/wwwroot/douyin/backend/.venv/bin/python -m uvicorn main:app --host 0.0.0.0 --port 8000 Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target