DEV: Use docker links to set password environment variable in the hub.

Also, yell at people if they use the default password.
This commit is contained in:
Scott Sanderson
2014-11-02 21:40:58 -05:00
parent eee5e5d2ed
commit b34a6d7f83
5 changed files with 31 additions and 21 deletions

View File

@@ -6,5 +6,5 @@ RUN mkdir /docker-entrypoint-initdb.d
# startup, prior to the the database being started.
COPY initdb.sh /docker-entrypoint-initdb.d/init.sh
# Replace this with your own password.
ENV JPY_PSQL_PASSWORD arglebargle
# Uncomment and replace this with your own password.
# ENV JPY_PSQL_PASSWORD arglebargle

View File

@@ -1,5 +1,16 @@
#!/bin/bash
echo "";
echo "Running initdb.sh.";
if [ -z "$JPY_PSQL_PASSWORD" ]; then
echo "Need to set JPY_PSQL_PASSWORD in Dockerfile via command line";
exit 1;
elif [ "$JPY_PSQL_PASSWORD" == "arglebargle" ]; then
echo "WARNING: Running with password!"
echo "You are STRONGLY ADVISED to use your own password.";
fi
echo "";
# Start a postgres daemon, ignoring log output.
gosu postgres pg_ctl start -w -l /dev/null