初始化
This commit is contained in:
17
deploy/feishu-approval.service
Normal file
17
deploy/feishu-approval.service
Normal file
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=Feishu Approval Designer Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/feishu-approval
|
||||
Environment=NODE_ENV=production
|
||||
Environment=PORT=8080
|
||||
Environment=HOST=0.0.0.0
|
||||
ExecStart=/usr/bin/node server.js
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
18
deploy/start.sh
Normal file
18
deploy/start.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# CentOS 7 启动脚本(Node.js 16.x)
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
if ! command -v node >/dev/null 2>&1; then
|
||||
echo "[ERROR] node not found. Install Node.js 16.x first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NODE_MAJOR=$(node -p "process.versions.node.split('.')[0]")
|
||||
if [ "$NODE_MAJOR" -lt 16 ]; then
|
||||
echo "[ERROR] Node.js 16+ required. Current: $(node -v)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Starting with Node $(node -v) ..."
|
||||
exec node server.js
|
||||
Reference in New Issue
Block a user