Deploy: use Next standalone start + robust ssh tty
Some checks failed
CI / Frontend Lint & Type Check (push) Has been cancelled
CI / Frontend Build (push) Has been cancelled
CI / Backend Lint (push) Has been cancelled
CI / Backend Tests (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
Deploy / Build & Push Images (push) Has been cancelled
Deploy / Deploy to Server (push) Has been cancelled
Deploy / Notify (push) Has been cancelled

This commit is contained in:
2025-12-15 14:19:02 +01:00
parent 1cb4b64646
commit 49732fb649
2 changed files with 5 additions and 5 deletions

View File

@ -109,7 +109,7 @@ fi
# Step 3: Reload backend (graceful, no restart) # Step 3: Reload backend (graceful, no restart)
if ! $FRONTEND_ONLY; then if ! $FRONTEND_ONLY; then
echo -e "\n${YELLOW}[3/4] Reloading backend (graceful)...${NC}" echo -e "\n${YELLOW}[3/4] Reloading backend (graceful)...${NC}"
sshpass -p "$SERVER_PASS" ssh $SSH_OPTS $SERVER_USER@$SERVER_HOST << 'BACKEND_EOF' sshpass -p "$SERVER_PASS" ssh -tt $SSH_OPTS $SERVER_USER@$SERVER_HOST << 'BACKEND_EOF'
set -e set -e
cd ~/pounce/backend cd ~/pounce/backend
@ -150,7 +150,7 @@ fi
# Step 4: Rebuild frontend (in background to minimize downtime) # Step 4: Rebuild frontend (in background to minimize downtime)
if ! $BACKEND_ONLY; then if ! $BACKEND_ONLY; then
echo -e "\n${YELLOW}[4/4] Rebuilding frontend...${NC}" echo -e "\n${YELLOW}[4/4] Rebuilding frontend...${NC}"
sshpass -p "$SERVER_PASS" ssh $SSH_OPTS $SERVER_USER@$SERVER_HOST << 'FRONTEND_EOF' sshpass -p "$SERVER_PASS" ssh -tt $SSH_OPTS $SERVER_USER@$SERVER_HOST << 'FRONTEND_EOF'
cd ~/pounce/frontend cd ~/pounce/frontend
# Build new version # Build new version
@ -160,7 +160,7 @@ if ! $BACKEND_ONLY; then
if [ $BUILD_EXIT -eq 0 ]; then if [ $BUILD_EXIT -eq 0 ]; then
# Gracefully restart Next.js # Gracefully restart Next.js
NEXT_PID=$(pgrep -af 'next-serv|next start' | awk 'NR==1{print $1; exit}') NEXT_PID=$(pgrep -af 'next-serv|next start|node \\.next/standalone/server\\.js' | awk 'NR==1{print $1; exit}')
if [ -n "$NEXT_PID" ]; then if [ -n "$NEXT_PID" ]; then
echo " Restarting Next.js (PID: $NEXT_PID)..." echo " Restarting Next.js (PID: $NEXT_PID)..."
@ -173,7 +173,7 @@ if ! $BACKEND_ONLY; then
sleep 2 sleep 2
# Verify # Verify
NEW_PID=$(pgrep -af 'next-serv|next start' | awk 'NR==1{print $1; exit}') NEW_PID=$(pgrep -af 'next-serv|next start|node \\.next/standalone/server\\.js' | awk 'NR==1{print $1; exit}')
if [ -n "$NEW_PID" ]; then if [ -n "$NEW_PID" ]; then
echo " ✓ Frontend running (PID: $NEW_PID)" echo " ✓ Frontend running (PID: $NEW_PID)"
else else

View File

@ -5,7 +5,7 @@
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",
"start": "next start", "start": "HOSTNAME=0.0.0.0 PORT=3000 node .next/standalone/server.js",
"lint": "next lint" "lint": "next lint"
}, },
"dependencies": { "dependencies": {