Docker Node.js Hello World Example with Nginx and Apache HTTP Server for Reverse Proxy
10K+
To run & manage this simple Docker Node.js "Hello World" application on 18 different clouds and virtualization platforms (including vSphere, OpenStack, AWS, Rackspace, Microsoft Azure, Google Compute Engine, DigitalOcean, IBM SoftLayer, etc.), make sure that you either:
Customize & Run all the published Docker Node.js application templates and many other templates (including multi-tier Java application stacks, LAMP, LAPP, and LAOP Stacks, Mongo Replica Set Cluster, Drupal, Wordpress, MEAN.JS, etc.)
LB:
image: nginx:latest
publish_all: true
host: host1
mem_min: 50m
plugins:
- !plugin
id: 0H1Nk
restart: true
lifecycle: on_create, post_scale_out:AppServer, post_scale_in:AppServer
arguments:
# Use container_private_ip if you're using Docker networking
- servers=server {{node | container_private_ip}}:8080;
# Use container_hostname if you're using Weave networking
#- servers=server {{AppServer | container_hostname}}:8080;
node:
image: dchq/nodejs:latest
mem_min: 100m
host: host1
cpu_shares: 1
publish_all: false
cluster_size: 1
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
arguments:
# Use container_private_ip if you're using Docker networking
- BalancerMembers=BalancerMember http://{{node | container_private_ip}}:8080
# Use container_hostname if you're using Weave networking
#- BalancerMembers=BalancerMember http://{{node | container_hostname}}:8080
node:
image: dchq/nodejs:latest
mem_min: 100m
host: host1
cpu_shares: 1
publish_all: false
cluster_size: 1
docker pull dchq/nodejs:latest