This commit is contained in:
Matthew Dillon 2015-01-05 16:28:03 -09:00
parent 50c09481ec
commit 16e742fcd7
5 changed files with 59 additions and 4 deletions

View file

@ -0,0 +1,3 @@
FROM postgres:9.3
ADD dbsetup.sh /docker-entrypoint-initdb.d/

View file

@ -0,0 +1,10 @@
#!/bin/bash
gosu postgres postgres --single <<- EOSQL
CREATE USER "$PGUSER" WITH SUPERUSER PASSWORD '$PGPASSWORD';
CREATE DATABASE $PGUSER;
CREATE DATABASE $PGDB;
EOSQL
{ echo; echo "host all \"$PGUSER\" 0.0.0.0/0 md5"; } >> "$PGDATA"/pg_hba.conf