OpenProject is the leading open source project management software.
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.
 
 
 
 
 
 
openproject/docker/prod/postgres-db-init

12 lines
338 B

#!/bin/bash
set -e
set -o pipefail
PGUSER=${PGUSER:=postgres}
PGPASSWORD=${PGPASSWORD:=postgres}
chown -R postgres.postgres "$PGDATA"
pwfile=$(mktemp)
echo "$PGPASSWORD" > $pwfile
chown postgres $pwfile
su postgres -c "$PGBIN/initdb --pgdata=${PGDATA} --username=${PGUSER} --encoding=unicode --auth=trust --pwfile=$pwfile"
rm -f $pwfile