spatie / ray

Debug with Ray to fix problems faster
https://myray.app
MIT License
564 stars 102 forks source link

Can't make it work with laravel sail #705

Closed dseeger closed 2 years ago

dseeger commented 2 years ago

Hope someone had similar issues and knows a solution. I work with laravel sail on linux. Here my setup:

docker-compose.yml

services:
    laravel.test:
        build:
            context: ./docker/8.1
            dockerfile: Dockerfile
            args:
                WWWGROUP: '${WWWGROUP}'
        image: sail-8.1/app
        extra_hosts:
            - 'host.docker.internal:host-gateway'
        ports:
            - '${APP_PORT:-80}:80'
        environment:
            WWWUSER: '${WWWUSER}'
            LARAVEL_SAIL: 1
            XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
            XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
        volumes:
            - '.:/var/www/html'
        networks:
            - sail
        depends_on:
            - mysql
   ...

ray.php

...
'host' => 'host.docker.internal',
'port' => 23517,
'remote_path' => '/var/www/html',
'local_path' => '/home/dominik/Projects/myproject',
...

/etc/hosts on my host machine 127.0.0.1 host.docker.internal

/etc/hosts in my docker container 172.17.0.1 host.docker.internal

Still, the ray app doesn't receive anything. Any ideas?

dseeger commented 2 years ago

Very silly... I forgot to set a rule for port 23517 in ufw.