Skip to content

Commit

Permalink
feat(iptvboss): adding cronitor
Browse files Browse the repository at this point in the history
  • Loading branch information
groenator committed Mar 1, 2024
1 parent 9b24392 commit d4276d8
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@ RUN yum install -y wget cronie vlc \
# Create a new user with home directory set to /headless
RUN useradd -m -d /headless -s /bin/bash iptvboss

#Configure cronitor
ARG CRONITOR_ENABLE=false
ENV CRONITOR_KEY=$CRONITOR_KEY

RUN if [ "$CRONITOR_ENABLE" = "true" ]; then \
curl https://cronitor.io/install-linux?sudo=1 -H "API-KEY: $CRONITOR_KEY" | sh; \
fi
# Install Cronitor by default
RUN curl https://cronitor.io/install-linux?sudo=1 | sh

# Set the working directory
WORKDIR /headless
Expand All @@ -45,17 +40,28 @@ RUN wget "https://github.com/walrusone/iptvboss-release/releases/latest/download
mv iptvboss-3.4.160.0 /usr/lib/iptvboss && \
rm -f iptvboss-3.4.160.0-linux-amd64.tar.gz

# Expose VNC port
EXPOSE 5901
EXPOSE 6901
ENV PATH="/usr/lib/iptvboss/bin:${PATH}"

# Configure cronitor if enabled and API key is provided
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; \
fi

# Switch back to the non-root user
USER 1000
ENV PATH="/usr/lib/iptvboss/bin:${PATH}"

# Apply cron job
RUN crontab /var/spool/crontab/iptvboss/iptvboss-cron

#Configure cronitor
ARG CRONITOR_ENABLE=false
RUN if [ "$CRONITOR_ENABLE" = "true" ]; then \
cronitor discover; \
fi

# Expose VNC port
EXPOSE 5901
EXPOSE 6901

0 comments on commit d4276d8

Please sign in to comment.