I've created a docker container with node:6.9.1, compass, bower, gulp, polymer-cli installed. Exposed port 8080.
Mounted the https://codelabs.developers.google.com/codelabs/polymer-2-carousel/ sample project to the app folder of my container.
Now when I start my container and run polymer serve I could access the page using localhost:8080 inside my container. But the same is not accessible from the host machine using the container's IP address and the port.
polymer serve as the commandThe web application index.html is rendered
Connecting to 172.19.0.2:8080... failed: Connection refused.
try polymer serve --hostname 0.0.0.0. Information on this was just added to the README
Thank you very much @FredKSchott it works with the proposed solution.
馃憤
It is broken again from polymer-cli 0.18.0. :(
0.17.0 works as expected.
Can we re-open @FredKSchott?
@NicolasRannou do you have more details? There wasn't an actual fix for this, besides using the --hostname flag. What exactly isn't working?
@justinfagnani sure! I dig up a bit to get more details and here is the results:
As you know - starting the polymer server in the docker container as: polymer serve --hostname 0.0.0.0 starts a server on port 8080 by default.
Then I map port 8080 from the container to the host machine port 8050.
=> I can not access the content being served by polymer from the host on port 8050.
If I run polymer serve --hostname 0.0.0.0 --port 8080 instead of polymer serve --hostname 0.0.0.0 in the container, then the mapping works properly and I can access my app from the host.
Does it make sense? Can you see why explicitly setting port would work?
Thanks! No big deal anyway as we know the workaround for now -
@NicolasRannou The default port being served is 8081 so if you're mapping 8080 that could be why?
Wow yes I missed that sorry about it :/
So I guess the default port switch happened between v17 and v18, I thought it was only live in the @next version.
Thanks and sorry for the noise @justinfagnani @jsilvermist
Most helpful comment
try
polymer serve --hostname 0.0.0.0. Information on this was just added to the README