Consul, Registrator & Fabio Integration

Wise G
Wise G
Aug 4, 2017 · 2 min read
/etc/default/docker
DOCKER_OPTS="--dns 172.17.0.1 --dns 8.8.8.8 --dns-search service.consul"
docker run -d -p 8500:8500 -p 172.17.0.1:53:8600/udp -p 8400:8400 gliderlabs/consul-server -node myconsul -bootstrap
docker run -d -v /var/run/docker.sock:/tmp/docker.sock --net=host gliderlabs/registrator -internal consul://localhost:8500
docker run -d -p :80 -e "SERVICE_80_NAME=web" -e SERVICE_TAGS=urlprefix-/ -e "SERVICE_80_ID=http1" -e "SERVICE_80_CHECK_HTTP=true" -e "SERVICE_80_CHECK_HTTP=/" --name=nginx1 nginx
fabio.properties
registry.consul.addr = <consul ip>:8500
docker run -d -p 80:9999 -p 9998:9998 -v $PWD/fabio.properties:/etc/fabio/fabio.properties fabiolb/fabio
docker run -d -p :80 -e "SERVICE_80_NAME=web" -e SERVICE_TAGS=urlprefix-/ -e "SERVICE_80_ID=http2" -e "SERVICE_80_CHECK_HTTP=true" -e "SERVICE_80_CHECK_HTTP=/" --name=nginx2 nginx
http://<fabio ip>:9998
http://<fabio ip>

Wise G

Written by

Wise G

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade