diff --git a/Dockerfile b/Dockerfile index 3d5e920..3cad721 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,10 +16,8 @@ RUN \ composer && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ - curl \ fontconfig \ memcached \ - netcat-openbsd \ php8-ctype \ php8-curl \ php8-dom \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 017a6ea..af97fb0 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -16,10 +16,8 @@ RUN \ composer && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ - curl \ fontconfig \ memcached \ - netcat-openbsd \ php8-ctype \ php8-curl \ php8-dom \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 0f79aa0..eaf7a8f 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -16,10 +16,8 @@ RUN \ composer && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ - curl \ fontconfig \ memcached \ - netcat-openbsd \ php8-ctype \ php8-curl \ php8-dom \ diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 5c249dc..e2840d0 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -36,7 +36,7 @@ done # Echo init finish for test runs if [ -n "${TEST_RUN}" ]; then - echo '[services.d] done.' + echo '[ls.io-init] done.' fi # Create API key if needed @@ -121,24 +121,22 @@ if ! grep -qx '^post_max_size.*$' /config/php/php-local.ini; then echo 'post_max_size = 100M' >>/config/php/php-local.ini fi -# check for the mysql endpoint for 30 seconds -END=$((SECONDS + 30)) -while [ ${SECONDS} -lt ${END} ] && [ -n "${DB_HOST}" ]; do - if /usr/bin/nc -z "${DB_HOST}" "${DB_PORT}"; then - if [ -n "$(/usr/bin/nc -w1 "${DB_HOST}" "${DB_PORT}")" ]; then - if [ -n "${RUN}" ]; then - break - fi - RUN="RAN" - # we sleep here again due to first run init on DB containers - if [ ! -f /dbwait.lock ]; then - sleep 5 - fi - else - sleep 1 +# check for the mysql endpoint +echo "Waiting for DB to be available" +END=$((SECONDS+30)) +while [[ ${SECONDS} -lt ${END} ]] && [[ -n "${DB_HOST+x}" ]]; do + if [[ $(/usr/bin/nc -w1 "${DB_HOST}" "${DB_PORT}" | tr -d '\0') ]]; then + if [[ -n "${RUN}" ]]; then + break fi + RUN="RAN" + # we sleep here again due to first run init on DB containers + if [[ ! -f /dbwait.lock ]]; then + sleep 5 + fi + else + sleep 1 fi - sleep 1 done # update database - will set up database if fresh, or, migrate existing