mirror of
https://github.com/bitnami/containers.git
synced 2026-03-17 14:57:40 +08:00
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:
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user