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
+1 -3
View File
@@ -4,14 +4,12 @@ FROM node:22-slim
# Set the working directory
WORKDIR /workspace
# Install PM2 globally
RUN npm install -g pm2
# Install git, openssh-client, openssh-server, and other necessary packages
RUN apt-get update && apt-get install -y \
git \
openssh-client \
openssh-server \
screen \
iputils-ping \
software-properties-common \
sudo \
+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