Test your Application Locally in a Docker Setup

Prerequisites

  • Docker should be installed on your machine.

Procedure

  1. Execute the command in a docker terminal.
    docker run -i -d -p 8080:8080 bwce-http-reqresp-app 
    
    
  2. Execute the following command to views the logs to make sure that the application has successfully started.
    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.
  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.