try replacing with screen
Build and Push Docker Images / build-and-push (push) Successful in 3m1s

This commit is contained in:
2026-06-08 16:53:52 +02:00
parent 2f8ef46e75
commit 448c33d842
2 changed files with 11 additions and 5 deletions
+10 -2
View File
@@ -329,5 +329,13 @@ if [ -z "$RUN_COMMAND" ]; then
fi
fi
# Start the application with pm2 using the specified package manager and run command
exec pm2-runtime "$PACKAGE_MANAGER run $RUN_COMMAND"
# Start the application in a detached screen session so it can be attached interactively
SCREEN_SESSION=${SCREEN_SESSION:-app}
screen -dmS "$SCREEN_SESSION" bash -c "$PACKAGE_MANAGER run $RUN_COMMAND; echo \"Process exited with code \$?\"; exec bash"
echo "Application started in screen session '$SCREEN_SESSION'"
echo "Attach with: screen -r $SCREEN_SESSION"
echo "Detach without stopping: Ctrl+A then D"
exec sleep infinity