diff --git a/README.md b/README.md index e870add..7052ca1 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,38 @@ To create a running container do: sudo docker run --name "postgis" -p 25432:5432 -d -t kartoza/postgis ``` +You can also use the following environment variables to pass a +user name and password. + +* -e USERNAME= +* -e PASS= + +These will be used to create a new superuser with +your preferred credentials. If these are not specified then the postgresql +user is set to 'docker' with password 'docker'. + +## Convenience run script + +For convenience we have provided a bash script for running this container +that lets you specify a volume mount point and a username / password +for the new instance superuser. It takes these options: + +``` +OPTIONS: + -h Show this message + -n Container name + -v Volume to mount the Postgres cluster into + -u Postgres user name (defaults to 'docker') + -p Postgres password (defaults to 'docker') +``` + +Example usage: + +``` +./run-postgis-docker.sh -v /tmp/foo/ -n postgis -u foo -p bar + +``` + ## Connect via psql Connect with psql (make sure you first install postgresql client tools on your diff --git a/start-postgis.sh b/start-postgis.sh index 8cf9aa0..82e3c0a 100755 --- a/start-postgis.sh +++ b/start-postgis.sh @@ -2,8 +2,6 @@ # This script will run as the postgres user due to the Dockerfile USER directive -set -x - DATADIR="/var/lib/postgresql/9.3/main" CONF="/etc/postgresql/9.3/main/postgresql.conf" POSTGRES="/usr/lib/postgresql/9.3/bin/postgres"