Skip to content

Commit

Permalink
fix(iptvboss): fixing cronitor discovery cli
Browse files Browse the repository at this point in the history
  • Loading branch information
groenator committed Mar 1, 2024
1 parent 62f9017 commit a41686c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
15 changes: 15 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"

0 comments on commit a41686c

Please sign in to comment.