1
0
mirror of https://github.com/docker-library/postgres.git synced 2025-07-28 10:42:06 +03:00

Initial Dockerfile installing from http://apt.postgresql.org

This commit is contained in:
Tianon Gravi
2014-06-23 10:03:54 -06:00
commit e2971da001
2 changed files with 47 additions and 0 deletions

18
docker-entrypoint.sh Executable file
View File

@ -0,0 +1,18 @@
#!/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 "$@"