Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable browser sync form docker #10

Closed
titaniumbones opened this issue Nov 10, 2017 · 5 comments
Closed

enable browser sync form docker #10

titaniumbones opened this issue Nov 10, 2017 · 5 comments

Comments

@titaniumbones
Copy link
Owner

titaniumbones commented Nov 10, 2017

I nthe current master branch, browser-sync starts up and it's possible to connect to the browser-sync ui at localhost:3001. However, localhost:3000 redirects to localhost:8080, which does not autoupdate. inspecting code does not show a snippet at localhhost_8080, unsurprisingly.

THe problem here is htat htere's no consistent way to set a localhost proxy from within a docker container. browser-sync gets confused when you try to do this and can't distinguish between lcahost_80 inside the machine (which is exposed as localhost:8080) and localhost:80 in the host environment. So, it gets confused and nothing is displayed.

someone grappling with a solution that doesn't work for me: https://stackoverflow.com/questions/42456424/browsersync-within-a-docker-container
Here's a possible solution: https://stackoverflow.com/questions/39493490/provide-static-ip-to-docker-containers-via-docker-compose

this says maybe you need docker v 3

@titaniumbones
Copy link
Owner Author

problem appears somewhat intractable. Tried this, but to no avail yet: https://docs.docker.com/compose/networking/#links
Here's a complex workaround that involves adding a line to /etc/hosts in macos: mkenney/docker-npm#6
here's an alternative project organization, which ufortunately requires students to install npm natively on their own computers: https://github.com/creative-workflow/wordpress-docker

crazy vuejs based theme that changes the whole ballgame: https://github.com/lyzs90/vuewp
another insane framework, with lots of differences from ours: https://github.com/fabrica-wp/fabrica-dev-kit
https://css-tricks.com/fabrica-dev-kit/

someone who thinks we can do it with the local.dev name, but doesn't work for me: https://fayway.github.io/docker-php-symfony-wordpress/

a tutorial series that ends with something called wocker: https://www.sitepoint.com/wocker-easy-dockerized-wordpress/

@titaniumbones
Copy link
Owner Author

another guy who says he has the answer, but this hard-coding method did not work for me: https://github.com/optimized/docker-wordpress-gulp-starter-kit

@titaniumbones
Copy link
Owner Author

super cool looking setup, a little sophisticated for us:
https://github.com/chriszarate/docker-compose-wordpress/blob/master/docker-compose.yml

@titaniumbones
Copy link
Owner Author

@titaniumbones
Copy link
Owner Author

fixed this by adding a static snippet to the theme files themselves, rather than trying to access localhost:8080 from localhost:3000, which gets docker all ocnfused because the scope of localhost differs in the container and the host. THis gets around the issue because, rather than doing the proxy work from inside the gulp container, we're doing it from the browser itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant