Omnibus-style container for Rebased and Soapbox
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
537 B

set -e
echo "-- Waiting for database..."
while ! pg_isready -d $DATABASE_URL -t 1; do
sleep 1s
COUNT=$(psql -p 5433 -q -c "select count(datname) from pg_catalog.pg_database where datname = 'pleroma'" -t -A | tr -d '\n');
if [ "$COUNT" -lt "1" ]; then
echo "Creating database..."
psql -p 5433 -q -c "create user pleroma with encrypted password 'bleromer'"
psql -p 5433 -q -c "create database pleroma with owner = 'pleroma'"
psql -p 5433 -q -c "grant all privileges on database pleroma to pleroma"