Testing the Application Locally in a Docker Setup

Prerequisites

Docker installed on your machine.

Procedure

  1. Execute the following command on a docker terminal to run the application image:
    docker run -i -d -p 8080:8080 -p 8090:8090 -e COMMAND_NAME=WikiNews-Service bwce-hystrix.app
    
  2. Execute the following command to view the logs to make sure that the application has started successfully.
    docker logs <container name>
    
    
  3. Get the IP address for the Docker machine.
  4. Edit the request_news.html file. Replace the URL "http://127.0.0.1:8080" with the IP address of the Docker machine and the port number.
  5. Save the file.
  6. Open the request_news.html file in a web browser.
  7. Click the Get News from Wiki! button to request headlines from the associated web page.

Result

In your Hystrix dashboard, use the following to view the configured command:
http://<DOCKER-HOST-IP>:8090/hystrix.stream