store DB password in secret. make entrypoint more robust.
This commit is contained in:
+12
-5
@@ -23,16 +23,23 @@ file_env() {
|
||||
|
||||
file_env "DEVISE_SECRET"
|
||||
file_env "SECRET_COOKIE_TOKEN"
|
||||
file_env "POSTGRES_PASSWORD"
|
||||
export DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db/${POSTGRES_DB}"
|
||||
|
||||
if test ! -f /loomio/storage/migrations_ran; then
|
||||
echo "first deploy, running migrations..."
|
||||
rake db:setup
|
||||
touch /loomio/storage/migrations_ran
|
||||
fi
|
||||
if [ -n "$1" ]; then
|
||||
echo "Running '$1'"
|
||||
$1
|
||||
else
|
||||
if [ ! -f /loomio/storage/migrations_ran ] && [ "${TASK:-}" = "worker" ]; then
|
||||
echo "first deploy, running DB setup..."
|
||||
rake db:setup
|
||||
touch /loomio/storage/migrations_ran
|
||||
fi
|
||||
|
||||
echo "running DB migrations..."
|
||||
rake db:migrate
|
||||
echo "DB migrations finished"
|
||||
|
||||
echo "starting loomio!"
|
||||
/loomio/docker_start.sh
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user