Meet Jake, a DevOps engineer at a mid-sized tech company. Jake’s team recently developed a JavaScript application that showcases the fundamentals of web development. However, they’ve identified a challenge: to ensure the application runs consistently across various environments, they need to containerize it using Docker.
In this article, we’ll walk through the problem statement, the challenges Jake faces, the tools he needs, and the steps he can take to containerize the application.

Jake’s company has a growing number of applications deployed across multiple environments (development, staging, production). The team noticed frequent discrepancies in how the application behaves due to differences in environment configurations. The solution is to containerize the application to create a consistent and portable runtime environment.
Jake’s task:
Jake faces a few key challenges:
Before Jake begins, he needs to ensure the following tools are installed on his local machine:
🚨 Question
Hey Jake, do you have the index.html file ready for the JavaScript application?
If not, you can download app file and place it in the hello-world-app/ directory as shown below:
hello-world-app/
└── index.html
Once you have the file in place, you can proceed with the next steps to containerize the application.
🚨 Question
Hey Jake, could you create a Dockerfile in the hello-world-app/ directory to containerize the application?
hello-world-app/
└── Dockerfile
🚨 Question
Hey Jake, are you ready to build the Docker image for your application? Just run the following command in your terminal:
docker build -t hello-world-app .
This will create a Docker image named hello-world-app using the Dockerfile you just created.
🚨 Question
Hey Jake, are you ready to run the containerized application locally to see it in action? You can use the following command to start the container:
docker run -d -p 8080:80 hello-world-app
This will map port 80 inside the container to port 8080 on your local machine. Once it’s running, you can open your browser and navigate to http://localhost:8080 to check if everything is working correctly.
Jake opens a browser and navigates to http://localhost:8080 to ensure the application is running successfully.
Through above steps, Jake would successfully containerized the JavaScript application. The containerization ensures consistent behavior across environments and sets the foundation for automated deployments.
This simple exercise demonstrates the power of Docker and prepares Jake to tackle more complex applications in the future!
If you wish to review Jake’s work in detail, the solution is present in file 📕 devops-challenges-2-solution.