Bud inside a container. Not getting it to work they way needed in dev

I am using Docker together with latest Sage/Bedrock.

in docker-compose I set these two. And it works as intended when the container runs.
WP_HOME: http://localhost:8080
WP_SITEURL: http://localhost:8080/wp

When starting up docker, as well as yarn dev (INSIDE the running containers terminals), localhost:8080 gives me a fully working site, I can navigate it and all. But the dev-url does not work, can not be reached the browser says. So the Hot reloading and the smooth development mode is out of the window sadly.

docker-compose file, opening the correct ports and all.


the localhost:3000 can not be reached in the browser with the setup above.

This works better, but not the solution

Using the for the setUrl works and can be navigated to, but then other things seems not to work properly with loading assets, as well as CORS… .and it seems wrong to not be able to just use the localhost:3000 as I have done with sites prior to upgrade to Sage 10/bud.js etc.

What am I doing wrong?

Hi @hejamartin,

Using for setUrl is correct in this case (Bud will bind to all interfaces).

Depending on your Docker setup (are you on Mac or Windows?), localhost may resolve internally to the Docker VM’s loopback interface, not your host machine. Docker on Linux will obviously resolve localhost to your host loopback.

What errors do you see relating to hot reloading and CORS?

1 Like

Hi @talss89

Okey, first I did not thought it would be correct, since not was the default way in the sage install. But then again - they dont know my setup, use of docker etc.

But previously, before - when using Sage 9, or laravels mix.js - and so…
I am used to use the localhost:3000 for the hot reloading.

I have managed to clear my errors and CORS on the now.
But I thought it would be better of to use the localhost:3000, but now I guess I do not have to do that - but have to change my Documentation in all my 30+ sites.