]> git.parisson.com Git - docker-django-scripts.git/commitdiff
restore db + up
authorEmilie <zawadzki@ircam.fr>
Fri, 23 Mar 2018 12:04:39 +0000 (13:04 +0100)
committerEmilie <zawadzki@ircam.fr>
Fri, 23 Mar 2018 12:04:39 +0000 (13:04 +0100)
build/front.sh
misc/wait.sh [new file with mode: 0755]
prod/up.sh

index 8732c3440d40a28a5dec1fbf7b313b8ed1c9af20..6d9328e4191a0a363a72f88c09f11b7b8aac77c1 100755 (executable)
@@ -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 (executable)
index 0000000..202c4d1
--- /dev/null
@@ -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'
index 3c985fd9ed7a3bf8a2dd52cd1ae5c5678e5779d2..07fa2c48432748dd233fdbf814da5d64d9eebd30 100755 (executable)
@@ -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