Public | Automated Build

Last pushed: a year ago
Short Description
Simple Node.js service that sends a hello response
Full Description


Simple service for demo purposes. Responds with [<hostname>]helloto anyGET` request.
It's a slight variation on the canonical Node.js example.

Running pingerjs

$ docker run -it --rm -p 3000:3000 --name pingerjs appcelerator/pingerjs


$ docker service create -p 3000:3000 --name pingerjs appcelerator/pingerjs

Scaling pingerjs

Try scaling scaling pingerjs up

$ docker service scale pingerjs=3

Confirm all the replicas are running as the service scales to the desired amount

$ docker service 
$ docker service ls --filter name=pingerjs
ID            NAME      REPLICAS  IMAGE                  COMMAND
bfjh7nervm3z  pingerjs  3/3       appcelerator/pingerjs

Then test

$ curl localhost:3000/
[f0afaf6c5ea5] hello

Each time you curl, you should see a different hostname in the brackets of the response
as Docker automatically load balances requests among all the service replicas.


Because HTTP/1.1 defaults to persistent connections, to see the same result for
demo purposes in the browser, the ping service closes the HTTP connection with each response
by setting Connection: close in the response header.


bin/ - builds an alpine-based image: appcelerator/pingerjs

bin/ - convenience script for docker run ...

bin/ - convenience script for docker service create ...

bin/ - convenience script for docker service rm ...

Docker Pull Command
Source Repository