entrypoint.sh 963 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. for file in /iptv-api-config/*; do
  3. filename=$(basename "$file")
  4. target_file="$APP_WORKDIR/config/$filename"
  5. if [ ! -e "$target_file" ]; then
  6. cp -r "$file" "$target_file"
  7. fi
  8. done
  9. . /.venv/bin/activate
  10. (crontab -l ; \
  11. if [ -n "$UPDATE_CRON1" ]; then echo "$UPDATE_CRON1 cd $APP_WORKDIR && /.venv/bin/python main.py"; fi; \
  12. if [ -n "$UPDATE_CRON2" ]; then echo "$UPDATE_CRON2 cd $APP_WORKDIR && /.venv/bin/python main.py"; fi) | crontab -
  13. # dcron log level
  14. # LOG_EMERG 0 [* system is unusable *]
  15. # LOG_ALERT 1 [* action must be taken immediately *]
  16. # LOG_CRIT 2 [* critical conditions *]
  17. # LOG_ERR 3 [* error conditions *]
  18. # LOG_WARNING 4 [* warning conditions *]
  19. # LOG_NOTICE 5 [* normal but significant condition *]
  20. # LOG_INFO 6 [* informational *]
  21. # LOG_DEBUG 7 [* debug-level messages *]
  22. /usr/sbin/crond -b -L /tmp/dcron.log -l 4 &
  23. python $APP_WORKDIR/main.py &
  24. python -m gunicorn service.app:app -b 0.0.0.0:$APP_PORT --timeout=1000