How do I use PHP script to debug PHP scripts in a docker environment [on hold]

[docker://laradock_php-fpm:latest/]:php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9001 -dxdebug.remote_host=host.docker.internal /var/www/php-project/think test

[RedisException]
php_network_getaddresses: getaddrinfo failed: Name or service not known

https://laradock.io – I use it for my local development

    protected $options = [
        'host'       => 'redis',
        'port'       => 6379,
        'password'   => '',
        'select'     => 0,
        'timeout'    => 0,
        'expire'     => 0,
        'persistent' => false,
        'prefix'     => '',
    ];

Through the browser I can normally access my local site, the site can be connected to redis,but i can’t connected redis when I run scriptphp, IDK why

Source: StackOverflow