]> git.parisson.com Git - docker-django-scripts.git/commitdiff
[db] fix host for restoring
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 25 Feb 2020 16:01:56 +0000 (17:01 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 25 Feb 2020 16:01:56 +0000 (17:01 +0100)
dev/local/restore_db.sh

index 4104d6bee280b26d3f4d42dca508bd4eadc2d38a..5392fd3c3d3becb63b0ff4d8a3ca5806380cca89 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-/srv/bin/misc/wait-for-it/wait-for-it.sh -h localhost -p $DB_PORT;
+/srv/bin/misc/wait-for-it/wait-for-it.sh -h db -p $DB_PORT;
 
 set -e
 
@@ -8,7 +8,7 @@ echo "Restoring..."
 
 # import database functions of type
 if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then
-    gunzip < /srv/backup/mariadb.dump.gz | mysql -h localhost $MYSQL_DATABASE -uroot -p$MYSQL_ROOT_PASSWORD
+    gunzip < /srv/backup/mariadb.dump.gz | mysql -h db $MYSQL_DATABASE -uroot -p$MYSQL_ROOT_PASSWORD
 elif [ ! -z "$POSTGRES_PASSWORD" ]; then
     export PGPASSWORD=$POSTGRES_PASSWORD
     pg_restore -c -C -hdb -Upostgres -dpostgres  /srv/backup/postgres.dump