blob: dc0d510d259aaa9cab884c608e89b6d02626dca9 [file] [log] [blame]
#!/bin/sh
set -e
{
kc_secret=/tmp/passwd/keycloak/secret
kc_password=$(cat ${kc_secret})
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER keycloak WITH PASSWORD '${kc_password}';
CREATE DATABASE keycloak;
GRANT ALL PRIVILEGES ON DATABASE keycloak TO keycloak;
EOSQL
}