A simple, HTTP server (written with Flask) that returns a response based on the value of the ECHO_MESSAGE environment variable.
A pre-built image is available for use on Docker Hub.
teapow/http-echo
To build the image, run the following command from the root of this repository:
docker build . --tag=http-echo:latestAfter building the image, it can be run locally with:
docker run --rm --publish 8080:8080 --env ECHO_MESSAGE="Hello, world!" http-echo:latest You should be able to access the application by visiting http://localhost:8080/ in your browser.
The behaviour of the application can be modified via the following environment variables:
| Name | Default value | Description |
|---|---|---|
ECHO_MESSAGE |
"This is the default message." |
Controls the message returned in the HTTP response. |
SERVER_HOST |
"0.0.0.0" |
The hostname to listen on. |
SERVER_PORT |
8080 |
The port of the webserver. |
SERVER_DEBUG |
False |
Controls whether the webserver runs in debug mode. |