Last active
August 29, 2015 13:59
-
-
Save mikehadlow/10717291 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nornagon/postgres | |
MAINTAINER mike@suteki.co.uk | |
ADD sql sql | |
ADD create_db.sh /src/ | |
USER postgres | |
RUN /src/create_db.sh | |
------- create_db.sh | |
#! /bin/bash | |
id | |
/etc/init.d/postgresql start | |
psql --command "CREATE USER queuespy WITH SUPERUSER PASSWORD 'queuespy';" | |
createdb -O queuespy queuespy | |
psql -l | |
for i in /sql/tables/*.sql | |
do | |
psql --file=$i --dbname=queuespy | |
done | |
for i in /sql/static_data/*.sql | |
do | |
psql --file=$i --dbname=queuespy | |
done | |
/etc/init.d/postgresql stop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment