This simple micro-service demonstation utilises the following technologies:
This demo has 3 microservice api endpoints which you can connect to via making requests to the nginx container.
- http://127.0.0.1/
- This will provide you with a list of the currently available endpoints.
- http://127.0.0.1/hello/
- This endpoint has 2 containers associated with it providing loadbalancing and automatic failover if one stopped.
- http://127.0.0.1/secure/
- This endpoint is secure, requiring a valid HTTP header
API-KEY
before the request is handled by the upstream micro-service.curl --header "API-KEY:demo123" http://127.0.0.1/secure/
- This endpoint is secure, requiring a valid HTTP header
In the diagram below you can see how the docker containers interact with one another.
The following steps assume that you already have docker and docker-compose installed on your system.
- Edit
/container/nginx/Dockerfile
replacing__YOUR_MACHINE_IP__
with your machines IP address. - Run
docker-compose build
to build all the container images. - Run the microservice stack with
docker-compose up