diff --git a/Dockerfile b/Dockerfile index 9dfdbce..d0e960d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,27 +42,17 @@ RUN wget "https://github.com/walrusone/iptvboss-release/releases/latest/download ENV PATH="/usr/lib/iptvboss/bin:${PATH}" -# Entrypoint script to configure Cronitor and start VNC -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - # Switch back to the non-root user USER 1000 # Apply cron job RUN crontab /var/spool/crontab/iptvboss/iptvboss-cron -# 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 --auto; \ -# fi - # Expose VNC port EXPOSE 5901 EXPOSE 6901 -ENTRYPOINT ["/entrypoint.sh"] +# Execute the shell script +COPY entrypoint.sh /headless/entrypoint.sh + +ENTRYPOINT ["/headless/entrypoint.sh"] diff --git a/docker-compose.yaml b/docker-compose.yaml index 317251f..be96b93 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,11 +1,14 @@ version: "2.1" services: - iptvboss-vnc: + iptvboss: restart: always build: context: . dockerfile: Dockerfile - container_name: iptvboss-vnc + container_name: iptvboss + environment: + - CRONITOR_ENABLE=true + - CRONITOR_API_KEY=7151dcaa743f43e3b5f3c64fb4649dd9 networks: - portainer_network ports: diff --git a/entrypoint.sh b/entrypoint.sh old mode 100644 new mode 100755 index b87e30b..c8c6ece --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,15 +1,10 @@ #!/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 -} +if [ -n "$CRONITOR_API_KEY" ]; then + cronitor discover --auto --api-key "$CRONITOR_API_KEY" & +else + echo "CRONITOR_API_KEY not set. Please make sure it is defined." +fi -# Run the Cronitor configuration and discovery function -configure_cronitor - -# Start the VNC server or any other startup commands -exec "$@" +/dockerstartup/vnc_startup.sh --wait +```