1
0
mirror of https://github.com/docker-library/postgres.git synced 2025-11-19 00:22:57 +03:00
Files
postgres/9.0/docker-entrypoint.sh
2014-07-15 18:27:13 -06:00

19 lines
346 B
Bash
Executable File

#!/bin/bash
set -e
if [ "$1" = 'postgres' ]; then
chown -R postgres "$PGDATA"
if [ -z "$(ls -A "$PGDATA")" ]; then
gosu postgres initdb
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
{ echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf
fi
exec gosu postgres "$@"
fi
exec "$@"