Docker Community Forums

Share and learn in the Docker community.

Docker compose dynamic load-balancer

(Techyugadi) #1

Most orchestration scenarios using dockers need dynamic load-balancing. Support for a built-in dynamic load-balance option in the docker-compose.yml file would be awesome !
For example, in the .yml below a support for a “loadbalance” option with load-balancing policy could be:
build: .

  • db
  • "8000:8000"
  • "round-robin"
    image: postgres
    Now, if docker-compose is run using the following commands:
    docker-compose up
    docker-compose scale web=10
    the load-balancer should send the requests to the webapp instances in round-robin fashion.
    (May be the load-balancer could be pluggable)

(devmtl) #2

I don’t see the use case for compose.

I use this proxy repo It’s awesome and also does lb out of the box :slight_smile: