From a41686cf73e2217b08502daa2ba966bd7c7d1190 Mon Sep 17 00:00:00 2001 From: Bogdan Grosu Date: Fri, 1 Mar 2024 13:30:14 +0000 Subject: [PATCH] fix(iptvboss): fixing cronitor discovery cli --- Dockerfile | 13 +++++++++---- entrypoint.sh | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 5e16f99..2394cfb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,11 +52,16 @@ RUN crontab /var/spool/crontab/iptvboss/iptvboss-cron ARG CRONITOR_ENABLE=false ARG CRONITOR_API_KEY="" -RUN if [ "$CRONITOR_ENABLE" = "true" ] && [ -n "$CRONITOR_API_KEY" ]; then \ - echo "{ \"CRONITOR_API_KEY\": \"$CRONITOR_API_KEY\" }" > /etc/cronitor/cronitor.json && \ - cronitor discover --auto; \ -fi +# RUN if [ "$CRONITOR_ENABLE" = "true" ] && [ -n "$CRONITOR_API_KEY" ]; then \ +# echo "{ \"CRONITOR_API_KEY\": \"$CRONITOR_API_KEY\" }" > /etc/cronitor/cronitor.json && \ +# cronitor discover --auto; \ +# fi # Expose VNC port EXPOSE 5901 EXPOSE 6901 + +# Entrypoint script to configure Cronitor and start VNC +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..b87e30b --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Function to configure and discover Cronitor +configure_cronitor() { + if [ "$CRONITOR_ENABLE" = "true" ] && [ -n "$CRONITOR_API_KEY" ]; then + echo "{ \"CRONITOR_API_KEY\": \"$CRONITOR_API_KEY\" }" > /etc/cronitor/cronitor.json + cronitor discover --auto + fi +} + +# Run the Cronitor configuration and discovery function +configure_cronitor + +# Start the VNC server or any other startup commands +exec "$@"