chore: sync local changes after pulling remote updates

This commit is contained in:
xucheng 2025-10-30 08:12:58 +00:00
parent 515e2d53c9
commit 2852436a82
3 changed files with 35 additions and 0 deletions

20
pm2.config.js Normal file
View File

@ -0,0 +1,20 @@
module.exports = {
apps : [{
name: "frontend",
cwd: "./frontend",
script: "npm",
args: "start",
env: {
"PORT": 3000
}
}, {
name: "backend",
cwd: "./backend",
script: "./.venv/bin/uvicorn",
args: "app.main:app --host 0.0.0.0 --port 8000",
interpreter: "none",
env: {
"PYTHONPATH": "."
}
}]
};

View File

@ -62,6 +62,11 @@ cd frontend
echo "--> Changed directory to $(pwd)" echo "--> Changed directory to $(pwd)"
npm install npm install
echo "Frontend setup complete." echo "Frontend setup complete."
# --- Frontend Production Build ---
echo "Building frontend for production..."
npm run build
echo "Frontend build complete."
cd .. cd ..
echo "--> Changed directory to $(pwd)" echo "--> Changed directory to $(pwd)"

10
scripts/stop.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# 停止所有用 pm2 启动的服务,并清理进程
echo "Stopping all pm2 applications..."
pm2 stop all
echo "All pm2 applications stopped."
echo "Deleting all pm2 processes..."
pm2 delete all
echo "All pm2 processes deleted."