Testing the Application Locally in a Docker Setup

Before you begin

Docker installed on your machine.

    Procedure
  1. Run 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-resilience4j.app
    
  2. Run 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 order to view resilience4j metrics, a resilience4j stream URL is needed as follows:

http://<DOCKER-HOST-IP>:8090/resilience4j_metrics