entrypoint.sh 585 B

123456789101112131415161718192021
  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. service cron start &
  14. python $APP_WORKDIR/main.py &
  15. python -m gunicorn service.app:app -b 0.0.0.0:$APP_PORT --timeout=1000