From 1c197e6ec2ea8c19f7ecd2b86d9dc4989d6a29e7 Mon Sep 17 00:00:00 2001
From: anima
Date: Thu, 30 Jan 2025 18:21:59 +0100
Subject: [PATCH] ensure init.sh runs always
---
Dockerfile | 3 ++-
init.sh | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 9bbe597..2281da9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -43,4 +43,5 @@ EXPOSE 5665
VOLUME ["/data"]
WORKDIR /data
USER root
-CMD ["bash", "/root/init.sh"]
\ No newline at end of file
+ENTRYPOINT [ "bash", "/root/init.sh" ]
+CMD [ "/usr/sbin/icinga2", "daemon" ]
\ No newline at end of file
diff --git a/init.sh b/init.sh
index 70d5f03..66b4606 100644
--- a/init.sh
+++ b/init.sh
@@ -53,5 +53,5 @@ if [ ! -z "$ICINGA2_ICINGADB_REDIS_PASS" ]; then
sed -i "s|\(//\)*password = \".*\"|password = \"$ICINGA2_ICINGADB_REDIS_PASS\"|g" $ICINGA2_FILE_ICINGADB_CONF
fi
-# run icinga
-/usr/sbin/icinga2 daemon
\ No newline at end of file
+# run CMD
+exec "$@"
\ No newline at end of file