My environment:
Ubunut 17.04 LTS
npm --version: 5.6.0
nodejs --version: 4.7.2
angular cli version: 1.6.4
docker-compose file:
versi
In your docker-compose file, make sure to export the ports:
services:
node:
ports:
- 4200:4200
Ok, as you say in your question, your process is listening to connection on localhost:4200
.
Inside a docker container, localhost
is the address of the loopback device of the container itself, which is separated and not reachable from your host network.
You need to edit your node process in order to make it listen to all addresses by editing the entrypoint in your Dockerfile as follows:
ENTRYPOINT ["ng", "serve", "-H", "0.0.0.0"]