Following the Get Started: Stack server stuck loading page endlessly

docker, docker-compose

Solution

In some systems, curl connects to ip6 by default for localhost. So you can run curl using:

$ curl 127.0.0.1:80

or

$ curl -4 localhost:80

Problem

I've been following the docker get started guide quite closely - except for a few changes in my python app, which I have confirmed are working without issue from the version I have pushed to docker hub. However, when I get to Part 3 and attempt to load up `localhost:80`, the page simply loads endlessly. My commands: ``` $ docker swarm init Swarm initiated: ... $ docker stack deploy -c docker-compose.yml Creating network getstartedlab_webnet Creating service getstartedlab_web $ docker stack ps getstartedlab ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS fhxqr2u8hxar getstartedlab_web.1 mctague/friendlyhello:2 cube Running Running 29 seconds ago 4t9mu9r8147e getstartedlab_web.2 mctague/friendlyhello:2 cube Running Running 28 seconds ago duute2pvgu9z getstartedlab_web.3 mctague/friendlyhello:2 cube Running Running 30 seconds ago 9kav6v27qfjn getstartedlab_web.4 mctague/friendlyhello:2 cube Running Running 29 seconds ago 1s2imbiuk6e2 getstartedlab_web.5 mctague/friendlyhello:2 cube Running Running 29 seconds ago $ docker logs <one of the running containers> * Running on http://0.0.0.0:80/ (Press CTRL+C to quit) $ curl localhost:80 < either an endless loading that I have to cancel with ^C, *OR* Connection refused > ``` docker-compose.yml ``` version: "3" services: web: image: mctague/friendlyhello:2 deploy: replicas: 5 resources: limits: cpus: "0.1" memory: 50M restart_policy: condition: on-failure ports: - "80:80" networks: - webnet networks: webnet: ```

Original source