diff --git a/entrypoint.sh b/entrypoint.sh index cdf5922..7fb0cb5 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -72,7 +72,7 @@ pg_setup_hba_conf() { printf 'host replication %s %s trust\n' "$POSTGRES_PGPOOL_USERNAME" "${POSTGRES_NETWORK:-100.64.0.0/10}" fi printf '\n' - printf 'host all all all scram-sha-256' + printf 'host all all all scram-sha-256\n' } >> "$PGDATA/pg_hba.conf" } @@ -88,6 +88,7 @@ docker_setup_env if [[ ! -s "$PGDATA/PG_VERSION" ]]; then if [[ -z $POSTGRES_UPSTREAM ]] || [[ -z $POSTGRES_REPLICATOR_USERNAME ]]; then + echo ${POSTGRES_PASSWORD} initdb --username=postgres --pwfile=<(printf "%s\n" "${POSTGRES_PASSWORD}") pg_setup_conf pg_setup_hba_conf