Skip to content

Commit

Permalink
chore:update cron
Browse files Browse the repository at this point in the history
  • Loading branch information
Guovin committed Jan 22, 2025
1 parent 7d958f2 commit ba3a86d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends cron \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN (crontab -l ; \
if [ -n "$UPDATE_CRON1" ]; then echo "$UPDATE_CRON1 cd $APP_WORKDIR && /.venv/bin/python main.py"; fi; \
if [ -n "$UPDATE_CRON2" ]; then echo "$UPDATE_CRON2 cd $APP_WORKDIR && /.venv/bin/python main.py"; fi) | crontab -

EXPOSE $APP_PORT

COPY entrypoint.sh /iptv-api-entrypoint.sh
Expand Down
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ done

. /.venv/bin/activate

(crontab -l ; \
if [ -n "$UPDATE_CRON1" ]; then echo "$UPDATE_CRON1 cd $APP_WORKDIR && /.venv/bin/python main.py"; fi; \
if [ -n "$UPDATE_CRON2" ]; then echo "$UPDATE_CRON2 cd $APP_WORKDIR && /.venv/bin/python main.py"; fi) | crontab -

service cron start &

python $APP_WORKDIR/main.py &
Expand Down

0 comments on commit ba3a86d

Please sign in to comment.