diff --git a/proxy_docker/app/data/sqlmigrate20211105_0.7.0-0.8.0.sh b/proxy_docker/app/data/sqlmigrate20211105_0.7.0-0.8.0.sh index d615c0e..8c8e9ad 100644 --- a/proxy_docker/app/data/sqlmigrate20211105_0.7.0-0.8.0.sh +++ b/proxy_docker/app/data/sqlmigrate20211105_0.7.0-0.8.0.sh @@ -2,10 +2,6 @@ . ./trace.sh -trace "[sqlmigrate20211105_0.7.0-0.8.0.sh] Waiting for PostgreSQL to be ready..." -while [ ! -f "/container_monitor/postgres_ready" ]; do echo "PostgreSQL not ready" ; sleep 10 ; done -trace "[sqlmigrate20211105_0.7.0-0.8.0.sh] PostgreSQL ready!" - trace "[sqlmigrate20211105_0.7.0-0.8.0.sh] Checking if postgres is set up..." psql -h postgres -U cyphernode -c "\d" | grep "cyphernode_props" > /dev/null if [ "$?" -eq "1" ]; then diff --git a/proxy_docker/app/script/startproxy.sh b/proxy_docker/app/script/startproxy.sh index 6f855fe..3d2f995 100644 --- a/proxy_docker/app/script/startproxy.sh +++ b/proxy_docker/app/script/startproxy.sh @@ -34,13 +34,13 @@ else rm -f /container_monitor/proxy_dbfailed fi +trace "[startproxy] Waiting for PostgreSQL to be ready..." +while [ ! -f "/container_monitor/postgres_ready" ]; do echo "PostgreSQL not ready" ; sleep 10 ; done +trace "[startproxy] PostgreSQL ready!" + if [ ! -e ${DB_FILE} ]; then trace "[startproxy] DB not found, creating..." cat cyphernode.sql | sqlite3 $DB_FILE - - trace "[startproxy] Waiting for PostgreSQL to be ready..." - while [ ! -f "/container_monitor/postgres_ready" ]; do echo "PostgreSQL not ready" ; sleep 10 ; done - trace "[startproxy] PostgreSQL ready!" psql -h postgres -f cyphernode.postgresql -U cyphernode returncode=$? trace_rc ${returncode}