Buoy is simple containerized web app designed for testing load-balancing and demonstrating container concepts. It continuously calls an API endpoint to display basic system information without needing to refresh the page.
To download and run the latest tag from Docker Hub, simply run:
docker run -d -p 5000:5000 bcbrookman/buoy
A more complex example using multiple replicas and a container load-balancer like the one below can be run with docker stack deploy
or docker-compose --compatibility up -d
---
version: "3.3"
services:
traefik:
image: "traefik:v2.5"
container_name: "traefik"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "8000:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
buoy:
image: "bcbrookman/buoy"
deploy:
replicas: 3
labels:
- "traefik.enable=true"
- "traefik.http.services.buoy.loadbalancer.server.port=5000"
- "traefik.http.routers.buoy.rule=PathPrefix(`/`)"
- "traefik.http.routers.buoy.entrypoints=web"
- "traefik.http.routers.buoy.service=buoy"
This docker-compose file can also be found in examples/
Alternatively, you can build the container locally.
- Clone the repo
cd
into the repo- Run
docker build -t buoy .