Add basic Keycloak setup
diff --git a/postgres/docker/entrypoint b/postgres/docker/entrypoint
index 311a019..1782d31 100644
--- a/postgres/docker/entrypoint
+++ b/postgres/docker/entrypoint
@@ -11,7 +11,7 @@
echo $(mktemp -u XXXXXXXXXXXXXXXX) >${kc_secret}
fi
chown root:postgres ${kc_secret}
- chmod 440 ${kc_secret}
+ chmod 444 ${kc_secret}
}
exec docker-entrypoint.sh "$@"
diff --git a/postgres/init.sh b/postgres/init.sh
index dc0d510..6ef8e46 100755
--- a/postgres/init.sh
+++ b/postgres/init.sh
@@ -7,8 +7,7 @@
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;
+ CREATE USER keycloak WITH ENCRYPTED PASSWORD '${kc_password}';
+ CREATE DATABASE keycloak WITH ENCODING='UTF8' OWNER keycloak;
EOSQL
}