diff --git a/docker/entrypoints/helpers/pg_database_url.sh b/docker/entrypoints/helpers/pg_database_url.rb similarity index 75% rename from docker/entrypoints/helpers/pg_database_url.sh rename to docker/entrypoints/helpers/pg_database_url.rb index 89a36c164..759ef2f9a 100755 --- a/docker/entrypoints/helpers/pg_database_url.sh +++ b/docker/entrypoints/helpers/pg_database_url.rb @@ -5,6 +5,6 @@ require 'uri' if !ENV['DATABASE_URL'].nil? && ENV['DATABASE_URL'] != '' uri = URI(ENV['DATABASE_URL']) puts "export POSTGRES_HOST=#{uri.host} POSTGRES_PORT=#{uri.port} POSTGRES_USERNAME=#{uri.user}" -elif ENV['POSTGRES_PORT'].nil? || ENV['POSTGRES_PORT'] == '' - puts "export POSTGRES_PORT=5432" +elsif ENV['POSTGRES_PORT'].nil? || ENV['POSTGRES_PORT'] == '' + puts 'export POSTGRES_PORT=5432' end diff --git a/docker/entrypoints/rails.sh b/docker/entrypoints/rails.sh index 7b77e33db..8bdf0551c 100755 --- a/docker/entrypoints/rails.sh +++ b/docker/entrypoints/rails.sh @@ -10,7 +10,7 @@ echo "Waiting for postgres to become ready...." # Let DATABASE_URL env take presedence over individual connection params. # This is done to avoid printing the DATABASE_URL in the logs -$(docker/entrypoints/helpers/pg_database_url.sh) +$(docker/entrypoints/helpers/pg_database_url.rb) PG_READY="pg_isready -h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USERNAME" until $PG_READY