feat: Initial commit

This commit is contained in:
mrhid6
2025-09-12 11:35:25 +00:00
parent 225a305fc8
commit 5d273dacd0
12 changed files with 680 additions and 0 deletions

33
entry.sh Normal file
View File

@@ -0,0 +1,33 @@
#!/bin/bash
EXE="/opt/app/taskqueue-server"
chown -R appuser:appuser /opt/app
chmod -R 777 /opt/app
#Define cleanup procedure
cleanup() {
echo "Container stopped, performing cleanup..."
pid=$(ps -ef | awk '$8=="'${EXE}'" {print $2}')
kill -INT $pid
while true; do
echo "Waiting for process to finish"
pid=$(ps -ef | awk '$8=="'${EXE}'" {print $2}')
if [ "$pid" == "" ]; then
break
fi
sleep 5
done
exit 0
}
#Trap SIGTERM
trap 'cleanup' SIGTERM
hostname
su appuser -c "cd /opt/app && ${EXE}" &
wait $!
sleep 40