Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. if [ "$LOADBALNCER_SECRET" == "loadbalancer_secret" ] || [ "$SECRET_KEY_BASE" == "secret_key_base" ]; then
  3. echo "ERROR: Detected default SECRET_KEY_BASE or LOADBALANCER_SECRET. Please generate a random value."
  4. echo "Exiting..."
  5. exit 1
  6. fi
  7. servers="$(RAILS_ENV=$RAILS_ENV bundle exec rake servers 2>&1)"
  8. echo $servers
  9. if [ "$RAILS_ENV" = "production" ] && [ "$DB_ADAPTER" = "postgresql" ]; then
  10. while ! curl http://$DB_HOST:${DB_PORT:-5432}/ 2>&1 | grep '52'
  11. do
  12. echo "Waiting for postgres to start up ..."
  13. sleep 1
  14. done
  15. fi
  16. db_create="$(RAILS_ENV=$RAILS_ENV bundle exec rake db:create 2>&1)"
  17. echo $db_create
  18. if [[ $db_create == *"already exists"* ]]; then
  19. echo ">>> Database migration"
  20. bundle exec rake db:migrate
  21. else
  22. echo ">>> Database initialization"
  23. bundle exec rake db:schema:load
  24. fi
  25. exec tini -- bundle exec puma -C config/puma.rb "$@"
  26. #tail -f /dev/null
  27. #bundle exec puma -C config/puma.rb
  28. #bundle exec rails s -b 0.0.0.0 -p 3000