This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user