From 179bb841faeb8074e1f866c4bb70c3e7b213c53b Mon Sep 17 00:00:00 2001 From: Emilie Date: Fri, 23 Mar 2018 13:04:39 +0100 Subject: [PATCH] restore db + up --- build/front.sh | 2 +- misc/wait.sh | 16 ++++++++++++++++ prod/up.sh | 7 +++++-- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100755 misc/wait.sh diff --git a/build/front.sh b/build/front.sh index 8732c34..6d9328e 100755 --- a/build/front.sh +++ b/build/front.sh @@ -1,3 +1,3 @@ #!/bin/sh -docker-compose run app python /srv/app/manage.py build-front +docker-compose exec app python /srv/app/manage.py build-front diff --git a/misc/wait.sh b/misc/wait.sh new file mode 100755 index 0000000..202c4d1 --- /dev/null +++ b/misc/wait.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +host=$(env | grep _TCP_ADDR | cut -d = -f 2) +port=$(env | grep _TCP_PORT | cut -d = -f 2) + +echo -n "waiting for TCP connection to $host:$port..." + +while ! nc -w 1 $host $port 2>/dev/null +do + echo -n . + sleep 1 +done + +echo 'ok' diff --git a/prod/up.sh b/prod/up.sh index 3c985fd..07fa2c4 100755 --- a/prod/up.sh +++ b/prod/up.sh @@ -1,3 +1,6 @@ #!/bin/sh - -docker-compose -f docker-compose.yml -f env/prod.yml up `if [ "$1" = "-bg" ]; then echo "-d"; fi` \ No newline at end of file +options = "" +if [ "$1" = "-bg" ]; then + options = $options "-d"; +fi +docker-compose -f docker-compose.yml -f env/prod.yml up $options \ No newline at end of file -- 2.39.5