blob: dc0d510d259aaa9cab884c608e89b6d02626dca9 [file] [log] [blame]
Nico Huber5d7a1cb2023-07-23 19:36:14 +00001#!/bin/sh
2
3set -e
4
5{
6 kc_secret=/tmp/passwd/keycloak/secret
7 kc_password=$(cat ${kc_secret})
8
9 psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
10 CREATE USER keycloak WITH PASSWORD '${kc_password}';
11 CREATE DATABASE keycloak;
12 GRANT ALL PRIVILEGES ON DATABASE keycloak TO keycloak;
13EOSQL
14}