Skip to content

Instantly share code, notes, and snippets.

View amjadafanah's full-sized avatar

Amjad Afanah amjadafanah

View GitHub Profile
@amjadafanah
amjadafanah / Docker Java (Consul-Nginx-Tomcat-Solr-Mongo)
Created January 17, 2016 23:51
Docker Java application template with Nginx for load balancing, Tomcat application server, Solr for full-text search and Mongo as the underlying database. The service discovery is provided through Consul and Registrator containers.
Nginx:
image: dchq/nginx-consul:latest
publish_all: true
mem_min: 50m
host: host1
plugins:
- !plugin
id: GINmu
restart: true
lifecycle: on_create
@amjadafanah
amjadafanah / docker-nginx-dchq-service-discovery
Last active January 17, 2016 23:56
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
@amjadafanah
amjadafanah / Docker Java (ApacheLB-Tomcat-Solr-Mongo)
Last active January 18, 2016 00:03
Docker Java application template with Apache HTTP Server for load balancing, Tomcat application server, Solr for full-text search and Mongo as the underlying database. The service discovery is provided through DCHQ's plug-in framework. The service discovery framework in DCHQ provides event-driven life-cycle stages that executes custom scripts to…
HTTP-LB:
image: httpd:latest
publish_all: true
mem_min: 50m
host: host1
plugins:
- !plugin
id: uazUi
restart: true
lifecycle: on_create, post_scale_out:AppServer, post_scale_in:AppServer
@amjadafanah
amjadafanah / Docker Java (Nginx-Tomcat-Solr-MySQL)
Created January 18, 2016 00:04
Docker Java application template with Nginx for load balancing, Tomcat application server, Solr for full-text search and Mongo as the underlying database. The service discovery is provided through DCHQ's plug-in framework. The service discovery framework in DCHQ provides event-driven life-cycle stages that executes custom scripts to re-configure…
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
@amjadafanah
amjadafanah / Docker Mongo Replica Set
Created January 18, 2016 00:06
Docker Mongo Replica Set with support for auto-scaling. The service discovery is provided through DCHQ's plug-in framework. 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 n…
mongo_rs1_srv1:
image: mongo:latest
mem_min: 400m
publish_all: true
command: --replSet rs1
environment:
# inject clustered node ips
- MONGO_RS1_SRV2_IP={{mongo_rs1_srv2|container_private_ip}}
# The above mapping will insert comma separated ip list e.g. 10.1.1.1,10.1.12
plugins:
@amjadafanah
amjadafanah / Docker Hazelcast Cluster
Created January 18, 2016 00:11
Docker Hazelcast Cluster with support for auto-scaling The service discovery is provided through DCHQ's plug-in framework. 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 ne…
Hazelcast-Management-Center:
image: hazelcast/management-center:latest
# Use this configuration if deploying to a shared VM
publish_all: true
# (Recommended) Use this configuration if deploying to a dedicated VM
#ports:
# - 8080:8080
host: host1
environment:
- HAZELCAST_IP={{Hazelcast | container_private_ip}}
@amjadafanah
amjadafanah / openssl private key creation for Microsoft Azure
Created January 18, 2016 00:15
openssl private key creation for Microsoft Azure
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout <key-name>.pem -out <key-name>.pem
@amjadafanah
amjadafanah / openssl certificate generation for Microsoft Azure
Created January 18, 2016 00:16
openssl certificate generation for Microsoft Azure
openssl x509 -inform pem -in <key-name>.pem -outform der -out <cer-name>.cer
@amjadafanah
amjadafanah / docker-microsoft-azure-machine-compose-template
Created January 18, 2016 00:22
Docker Microsoft Azure Machine Compose Template in DCHQ
Machine:
# Note: Some of the fields are optional based on provider and can be left empty.
region: West US
description: This provisions a Docker-enabled Standard D2 virtual machine in West US.
instanceType: STANDARD_D3
image: b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140416.1-en-us-30GB/West US
count: 1
@amjadafanah
amjadafanah / dchq-plugin-in-machine-compose
Created January 18, 2016 00:24
Invoking DCHQ plug-in in Machine Compose
plugins:
- !plugin
id: <plugin-id>