Created
January 17, 2016 23:51
-
-
Save amjadafanah/2d5466ab41504f377584 to your computer and use it in GitHub Desktop.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nginx: | |
image: dchq/nginx-consul:latest | |
publish_all: true | |
mem_min: 50m | |
host: host1 | |
plugins: | |
- !plugin | |
id: GINmu | |
restart: true | |
lifecycle: on_create | |
arguments: | |
- APPSERVER_IP={{AppServer | container_private_ip}} | |
- SERVICE_NAME={{AppServer | SERVICE_NAME}} | |
- SERVICE_TAGS={{AppServer | SERVICE_TAGS}} | |
- CONSUL_IP={{Consul | container_private_ip}} | |
AppServer: | |
image: tomcat:8.0.21-jre8 | |
mem_min: 600m | |
host: host1 | |
cluster_size: 1 | |
environment: | |
- mongo_url={{Mongo|container_private_ip}}:27017/dchq | |
- solr_host={{Solr|container_private_ip}} | |
- solr_port=8983 | |
- SERVICE_NAME=app | |
- SERVICE_TAGS=production | |
plugins: | |
- !plugin | |
id: oncXN | |
restart: true | |
arguments: | |
- file_url=https://github.com/dchqinc/dchq-docker-java-solr-mongo-cassandra-example/raw/master/dbconnect.war | |
- dir=/usr/local/tomcat/webapps/ROOT.war | |
- delete_dir=/usr/local/tomcat/webapps/ROOT | |
Consul: | |
image: progrium/consul:latest | |
host: host1 | |
ports: | |
- "8300:8300" | |
- "8400:8400" | |
- "8500:8500" | |
- "8600:53/udp" | |
command: -server -bootstrap -advertise 10.0.2.15 | |
Registrator: | |
image: gliderlabs/registrator:latest | |
host: host1 | |
command: consul://<HOST_IP>:8500 | |
volumes: | |
- "/var/run/docker.sock:/tmp/docker.sock" | |
Solr: | |
image: solr:latest | |
mem_min: 300m | |
host: host1 | |
publish_all: false | |
plugins: | |
- !plugin | |
id: doX8s | |
restart: true | |
arguments: | |
- file_url=https://github.com/dchqinc/dchq-docker-java-solr-mongo-cassandra-example/raw/master/names.zip | |
Mongo: | |
image: mongo:latest | |
host: host1 | |
mem_min: 400m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment