postgres/rootfs/etc/cont-init.d/00-password

12 lines
376 B
Plaintext
Raw Normal View History

2017-09-04 14:00:44 +00:00
#!/usr/bin/with-contenv sh
cat <<EOF > /var/lib/postgresql/data/pg_hba.conf
local all all trust
EOF
s6-setuidgid postgres pg_ctl -D "$PGDATA" -o "-c listen_addresses='localhost'" -w start
s6-setuidgid postgres psql --command "ALTER USER postgres WITH PASSWORD '${POSTGRES_PASSWORD}';"
s6-setuidgid postgres pg_ctl -D "$PGDATA" -o "-c listen_addresses='localhost'" -w stop