services:
  haproxy:
    image: haproxy:1.7-alpine
    volumes:
      - ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
    links:
      - server-john
      - server-paul
      - server-george
      - server-ringo
    ports:
     - "3000:80"

  server-john:
    build: ./server
    links:
      - redis
    expose:
      - "3000"
    environment:
      - NAME=John

  server-paul:
    build: ./server
    links:
      - redis
    expose:
      - "3000"
    environment:
      - NAME=Paul

  server-george:
    build: ./server
    links:
      - redis
    expose:
      - "3000"
    environment:
      - NAME=George

  server-ringo:
    build: ./server
    links:
      - redis
    expose:
      - "3000"
    environment:
      - NAME=Ringo

  redis:
    image: redis:alpine
    expose:
      - "6379"
