Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

confroxy

5 Elements: Docker, Registrator, Consul, Consul Template, Nginx

Create Dockerfile for your service

Tools

Other Alternative
Another way to do that listen docker events manually (for example: node-docker-monitor) and register or deregister services from consul then update your proxy tool (for example: node-http-proxy)

run consul

docker run -it -h node \
 -p 8500:8500 \
 -p 8600:53/udp \
 gliderlabs/consul-server \
 -server \
 -bootstrap \
 -advertise localhost \
 -log-level debug

run registrator

docker run -d \
    --name=registrator \
    --net=host \
    --volume=/var/run/docker.sock:/tmp/docker.sock \
    gliderlabs/registrator:latest \
      consul://localhost:8500

run confroxy (preconfigured consul template and nginx service)

docker run -it  --net=host -e "CONSUL=127.0.0.1:8500" -e "SERVICE=trex-svc" -p 80:80 confroxy

build your service image

docker build -t trex/server .

run your service instances

docker service scale trex=3 will do that if you like to try new stuff (:

stating services manually

docker run -it -e "SERVICE=trex-svc" -p 8000:80 trex/server
docker run -it -e "SERVICE=trex-svc" -p 8001:80 trex/server
docker run -it -e "SERVICE=trex-svc" -p 8002:80 trex/server

About

5 Elements: Docker, Registrator, Consul, Consul Template, Nginx

Resources

License

Releases

No releases published

Packages

No packages published