#!/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 | |
} |