fix: disable MariaDB SSL for internal Docker networking + worker MySQL readiness wait
This commit is contained in:
@@ -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 "$@"
|
||||
|
||||
Reference in New Issue
Block a user