fix: disable MariaDB SSL for internal Docker networking + worker MySQL readiness wait

This commit is contained in:
Lizandro Guarnizo
2026-03-11 20:22:19 -05:00
parent 06e4ad6fd5
commit 1b9942442a
3 changed files with 24 additions and 2 deletions
+18
View File
@@ -11,4 +11,22 @@ if [ ! -f /var/www/html/vendor/autoload.php ]; then
cd /var/www/html && composer install --no-dev --optimize-autoloader --no-interaction 2>&1
fi
# Esperar a que MySQL esté disponible antes de arrancar el worker
DB_HOST="${DB_HOST:-mysql}"
DB_PORT="${DB_PORT:-3306}"
RETRIES=30
echo "Esperando MySQL en ${DB_HOST}:${DB_PORT}..."
while [ $RETRIES -gt 0 ]; do
if nc -z "$DB_HOST" "$DB_PORT" 2>/dev/null; then
echo "MySQL disponible."
break
fi
RETRIES=$((RETRIES - 1))
echo "MySQL no disponible, esperando... ($RETRIES intentos restantes)"
sleep 2
done
if [ $RETRIES -eq 0 ]; then
echo "ADVERTENCIA: MySQL no respondió después de 60s, arrancando worker de todas formas..."
fi
exec su-exec www "$@"