run-koel.sh 671 B

1234567891011121314151617181920212223
  1. set -e
  2. # WORKAROUND for koel:init crashing with
  3. # > In EncryptionServiceProvider.php line 42:
  4. # > No application encryption key has been specified.
  5. # 'php artisan key:generate' crashes the same way.
  6. APP_KEY_PATH=/etc/koel-app-key
  7. if [ ! -f $APP_KEY_PATH ]; then
  8. tr -dc '0-9a-zA-Z' </dev/urandom \
  9. | head -c32 >$APP_KEY_PATH
  10. chmod u=rw,g=,o= $APP_KEY_PATH
  11. echo generated random APP_KEY
  12. fi
  13. export APP_KEY="$(cat $APP_KEY_PATH)"
  14. set -x
  15. # TODO run non-interactively
  16. # TODO do not run yarn install (part of build)
  17. php artisan koel:init
  18. # TODO use apache or nginx https://koel.phanan.net/docs/#/?id=manually
  19. php artisan serve --host=0.0.0.0 --port 8080