blob: 6ef8e46b9276cc27edd6e14845d087dd6918646f [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 ENCRYPTED PASSWORD '${kc_password}';
CREATE DATABASE keycloak WITH ENCODING='UTF8' OWNER keycloak;
EOSQL
}