A simple Express app that responds to /ping with "pong" -- useful for debugging http services.
50K+
ping-pong is a simple Express app that responds to /ping with "pong" -- useful for debugging http services.
docker run -p 7777:80 -it --rm briceburg/ping-pong
binds ping-pong to :7777 on localhost. ctrl-c to exit. test in a new terminal
~ curl localhost:7777/ping
pong
I use ping-pong to test upstream load balancers like nginx-proxy and automatic LetsEncrypt SSL cert generation via the letsencrypt-nginx-proxy-companion container.
Here's an example v1 docker-compose.yml assuming nginx-proxy + letsencrypt companion are running on the docker host.
---
ping-pong:
image: briceburg/ping-pong
#ports:
#- "7777:80"
environment:
# ROUTING (for nginx-proxy container)
#####################################
VIRTUAL_HOST: ssl-test.mydomain.net
LETSENCRYPT_HOST: ssl-test.mydomain.net
LETSENCRYPT_EMAIL: [email protected]
docker-compose up
As a convenience, the Express routes have been abstracted to an include file. This allows you to build an image based on briceburg/ping-pong with custom behavior. Here, we build an image based on the provided Dockerfile and routefile examples.
cd /path/to/ping-pong repo
docker build -t custom-ping-pong -f custom-Dockerfile .
docker run -it --rm -p 7777:80 custom-ping-pong
&& viola! a 204 is returned.
~ curl -I localhost:7777
HTTP/1.1 204 No Content
X-Powered-By: Express
Date: Tue, 05 Jul 2016 21:05:05 GMT
Connection: keep-alive
Content type
Image
Digest
Size
11.1 MB
Last updated
about 10 years ago
docker pull briceburg/ping-pong