A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.
feat: add sigterm support (#2472)
Meier Lukasa5e0e8c1296e
diff --git a/development/docker-run.cmd b/development/docker-run.cmdindex 1f608898f..2ef22223b 100644--- a/development/docker-run.cmd+++ b/development/docker-run.cmd@@ -1 +1,2 @@-docker run -p 7575:7575 homarr:latest\ No newline at end of file+:: Please do not run this command in production. It is only for local testing.+docker run -p 7575:7575 -e SECRET_ENCRYPTION_KEY=0000000000000000000000000000000000000000000000000000000000000000 homarr:latest\ No newline at end of filediff --git a/scripts/entrypoint.sh b/scripts/entrypoint.shindex 54131a632..c362eac3a 100644--- a/scripts/entrypoint.sh+++ b/scripts/entrypoint.sh@@ -19,7 +19,7 @@ if [ "${PUID}" != "0" ] || [ "${PGID}" != "0" ]; thenfiif [ "${PUID}" != "0" ]; then- su-exec $PUID:$PGID "$@"+ exec su-exec $PUID:$PGID "$@"elseexec "$@"fidiff --git a/scripts/run.sh b/scripts/run.shindex 83833d5cd..d1c4dee86 100644--- a/scripts/run.sh+++ b/scripts/run.sh@@ -19,17 +19,37 @@ export AUTH_SECRET=$(openssl rand -base64 32)# 2. Create the nginx configuration file from the template# 3. Start the nginx serverenvsubst '${HOSTNAME}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf+# Start services in the background and store their PIDsnginx -g 'daemon off;' &+NGINX_PID=$!-# Start Redisredis-server /app/redis.conf &+REDIS_PID=$!-# Run the tasks backendnode apps/tasks/tasks.cjs &+TASKS_PID=$!node apps/websocket/wssServer.cjs &--# Run the nextjs server-node apps/nextjs/server.js & PID=$!--wait $PID+WSS_PID=$!++node apps/nextjs/server.js &+NEXTJS_PID=$!++# Function to handle SIGTERM and shut down services+terminate() {+ echo "Received SIGTERM. Shutting down..."+ kill -TERM $NGINX_PID $TASKS_PID $WSS_PID $NEXTJS_PID 2>/dev/null+ wait+ # kill redis-server last because of logging of other services+ kill -TERM $REDIS_PID 2>/dev/null+ wait+ echo "Shutdown complete."+ exit 0+}++# When SIGTERM (docker stop <container>) / SIGINT (ctrl+c) is received, run the terminate function+trap terminate TERM INT++# Wait for all processes+wait $NEXTJS_PID+terminate\ No newline at end of file