Skip to content

Commit

Permalink
fix(iptvboss): fixing cronitor job
Browse files Browse the repository at this point in the history
  • Loading branch information
groenator committed Mar 1, 2024
1 parent 4f1bba4 commit 73a51d7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 28 deletions.
18 changes: 4 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
7 changes: 5 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
19 changes: 7 additions & 12 deletions entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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
```

0 comments on commit 73a51d7

Please sign in to comment.