Files
docker-postgresql/assets/setup/install
T
2014-04-19 20:40:29 +05:30

30 lines
1.3 KiB
Bash

#!/bin/bash
set -e
# listen on all interfaces
cat >> /etc/postgresql/9.1/main/postgresql.conf <<EOF
listen_addresses = '*'
EOF
# allow remote connections to postgresql database
cat >> /etc/postgresql/9.1/main/pg_hba.conf <<EOF
host all all 0.0.0.0/0 md5
EOF
# remove the default database, will create from init
rm -rf /var/lib/postgresql/9.1/main
echo ""
echo "*************************************************************************"
echo "* Please login to postgresql and create the required database and *"
echo "* database user with remote login access so that other containers can *"
echo "* use it. *"
echo "* *"
echo "* e.g. *"
echo "* sudo -u postgres createuser db_user *"
echo "* sudo -u postgres psql *"
echo "* > \password db_user *"
echo "* sudo -u postgres createdb -O db_user db_name *"
echo "*************************************************************************"
echo ""