blob: 6ef8e46b9276cc27edd6e14845d087dd6918646f [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
Nico Huberf4fbab52023-07-25 10:57:08 +000010 CREATE USER keycloak WITH ENCRYPTED PASSWORD '${kc_password}';
11 CREATE DATABASE keycloak WITH ENCODING='UTF8' OWNER keycloak;
Nico Huber5d7a1cb2023-07-23 19:36:14 +000012EOSQL
13}