Laravel dusk refused to connect to host


#1

Hi, I’m trying all the day to make this work, following this tutorial (https://buddy.works/guides/how-run-laravel-dusk-selenium-tests) and I aways get the screenshot with the error “x.x.x.x refused to connect”.

The only thing different from the video is the php image and the version of laravel and dusk (I’m using the most recent of both).

Someone passed for something like? This is the last step for we definitely use buddy.works here.


#2

@ibrunotome, we’ve issued a task to a dev who wrote this guide to check things out. We’ll let you know asap.


#3

Thanks. I’m using a clone of this project: https://github.com/cretueusebiu/laravel-vue-spa, if this can help him to test/investigate.


#4

Hi @Octavia, any news about this issue? We planed to start to use buddy.works in our team in this week.

Here my docker-compose.yml file, where laravel dusk works perfectly. See the shared networks between the containers, I think that’s maybe is the problem.


#5

Sorry for not getting back to you earlier on that, @ibrunotome.

We’ve been investigating things and found a problem on your side. A replace has been made on the localhost phrase:
sed -i "s/localhost/$HOST_NAME/g" .env - you’ve got no localhost in this file; there’s only a hostname of your machine. Because of that, the replace fails to be made.

The thing is that the variable APP_URL in the .env should be set on this container’s address and that’s what the replace does.

Also, I can see that you’re using port 8080, so the APP_URL after switching should have such value, for instance:
`APP_URL=http://172.18.0.3:8080


#6

I have a .env.example that I copy on every execution (with localhost) to make the replace with the host. But the 8080 on the .env in parallel with the terminal command really did the things work perfectly now!

I really appreciate your help @Octavia and this great product too. Thanks!