Skip to content

Instantly share code, notes, and snippets.

@amjadafanah
Last active January 17, 2016 23:56
Show Gist options
  • Save amjadafanah/abccadd0db6abb7ac845 to your computer and use it in GitHub Desktop.
Save amjadafanah/abccadd0db6abb7ac845 to your computer and use it in GitHub Desktop.
Docker Service Discovery for a multi-tier Java application with Nginx load balancer. The service discovery framework in DCHQ provides event-driven life-cycle stages that executes custom scripts to re-configure application components. This is critical when scaling out clusters for which a load balancer may need to be re-configured or a replica se…
Nginx:
image: nginx:latest
publish_all: true
mem_min: 50m
host: host1
plugins:
- !plugin
id: 0H1Nk
restart: true
lifecycle: on_create, post_scale_out:AppServer, post_scale_in:AppServer, post_stop:AppServer, post_start:AppServer
arguments:
# Use container_private_ip if you're using Docker networking
- servers=server {{AppServer | container_private_ip}}:8080;
# Use container_hostname if you're using Weave networking
#- servers=server {{AppServer | container_hostname}}:8080;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment