Docker Community Forums

Share and learn in the Docker community.

Config haproxy for a node app


(Yossieliyahu1) #1

Hi,

I get 503 response trying to call haproxy for a simple node app.
The setting are very much like the classic load balancer sample from docker docs: https://docs.docker.com/docker-cloud/tutorials/load-balance-hello-world/

  1. haproxy and node app are both on the same Docker Node connecting to one DigitalOcean’s droplet. (ping return the right results)
  2. haproxy service and container endpoints return 503
  3. node app container endpoint is working fine
  4. The node app:
    Published port: dynamic->3000/tcp
    Command: node main.js 3000
  5. The haproxy:
    Published ports: 80->80/tcp 443->443/tcp 1936->1936/tcp
    Command: dockercloud-haproxy
    The haproxy is linked to the my node app service.

Any idea will be welcome … :slight_smile:
Thanks.


(Peter Pritchard) #2

my guess is that you needed to add:

volumes:
  - '/var/run/docker.sock:/var/run/docker.sock'