I'm doing the docker getting started guide: https://docs.docker.com/get-started/part3/#recap-and-cheat-sheet-optional
docker-compose.yml:
version: "3"
services:
web:
# replace username/repo:tag with your name and image details
image: username/repo:tag
deploy:
replicas: 5
resources:
limits:
cpus: "0.1"
memory: 50M
restart_policy:
condition: on-failure
ports:
- "80:80"
networks:
- webnet
networks:
webnet:
I deployed my app by running docker stack deploy -c docker-compose.yml getstartedlab
.
Then Accessing my service from curl which working fine curl -4 http://localhost
<h3>Hello World!</h3><b>Hostname:</b> 1532cae6e06f<br/>....
But I can't access it from chrome or postman by going to http://localhost:80
(it loads forever). Why and how can I fix it?
Update 19/10/17:
I can access my service in the browser from: http://192.168.1.68:80
.
It is the address of the leader node (which is the ip of my real machine also..).
But why can't I do it from localhost also?