https://github.com/joedborg/docker-compose-scaling
Example for using Docker Compose scale with Nginx
https://github.com/joedborg/docker-compose-scaling
docker docker-compose nginx scale
Last synced: 2 months ago
JSON representation
Example for using Docker Compose scale with Nginx
- Host: GitHub
- URL: https://github.com/joedborg/docker-compose-scaling
- Owner: joedborg
- Created: 2016-10-28T13:52:41.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-28T19:57:40.000Z (over 9 years ago)
- Last Synced: 2023-03-22T15:23:00.121Z (about 3 years ago)
- Topics: docker, docker-compose, nginx, scale
- Language: Nginx
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker Compose DNS Load Balancing Example
This is to demonstrate the Docker Compose `scale` command and how it can be
used with Nginx for instant scaling.
## Building
### Requirements
* Go
* Docker Compose
* GNU Make
To build, first compile the Go web application server. This will simply
respond with the container's ID.
```
$ make
```
## Running
```
$ docker-compose up -d
```
Then browse to [http://localhost](http://localhost) and see the name of the single application
container.
## Scaling
To scale the application server, run
```
$ docker-compose scale application=2
```
(or any number of instances). Then refresh the browser to see the container
name change as Docker's DNS resolver does round-robin.