Sign inSign up

int128/docker-lb-mapper

By int128

Updated almost 11 years ago

Image
0

242

int128/docker-lb-mapper repository overview

docker-lb-mapper

A daemon for provisioning mapping of nginx and Docker containers.

Concept

When an new Docker container is started, docker-lb-mapper does following:

  1. Regenerates a mapping file.
  • the nginx container must have a volume for a mapping file, e.g. /etc/nginx/containers volume.
  • the docker-lb-mapper container mounts the volume from it.
  1. Sends a signal (SIGHUP) to the nginx container.
  • docker-lb-mapper finds the nginx container which provides the volume.
  • docker-lb-mapper sends a signal via Docker API.

A mapping file consists of hostname, domainname and IP address of each container.

xxx.example.com 172.17.0.1;
yyy.example.com 172.17.0.2;
zzz.example.com 172.17.0.2;

How to use

Try the demo now. It requires Docker and Fig.

git clone https://github.com/int128/docker-lb-mapper.git
cd docker-lb-mapper/demo/
fig up

# Access to helloworld container
curl helloworld.lvh.me

# Not exists
curl dummy.lvh.me

See fig.yml and nginx configuration for details.

Tag summary

Content type

Image

Digest

sha256:794914841

Size

288.8 MB

Last updated

almost 11 years ago

docker pull int128/docker-lb-mapper