Update app-entrypoint.sh (#151)

* Update app-entrypoint.sh

Some database references were hard-coded to "mariadb" in the `app-entrypoint.sh` file.
They have been replaced by the corresponding variable.
Also, the port number has been added to the log output to help any missing configuration when using another DB engine than MariaDB.

* Update 8/debian-10/rootfs/app-entrypoint.sh

Co-authored-by: Miguel Ángel Cabrera Miñagorri <devgorri@gmail.com>

* Update 8/debian-10/rootfs/app-entrypoint.sh

Co-authored-by: Miguel Ángel Cabrera Miñagorri <devgorri@gmail.com>

Co-authored-by: Miguel Ángel Cabrera Miñagorri <devgorri@gmail.com>
This commit is contained in:
teriiehina
2021-11-23 00:28:17 -10:00
committed by GitHub
parent e1caf5c517
commit 19c78af88c

View File

@@ -62,11 +62,11 @@ wait_for_db() {
local db_address
db_address=$(getent hosts "$db_host" | awk '{ print $1 }')
local counter=0
log "Connecting to mariadb at $db_address"
log "Connecting to database at ${db_address}:${db_port}"
while ! nc -z "$db_address" "$db_port" >/dev/null; do
counter=$((counter + 1))
if [ $counter == 30 ]; then
log "Error: Couldn't connect to mariadb."
log "Error: Couldn't connect to the database"
exit 1
fi
log "Trying to connect to mariadb at $db_address. Attempt $counter."