DEV Community

GigiFitiany
GigiFitiany

Posted on

Docker 101

Why is Docker so powerful?

From what I've gathered and from reading about and tooling around with Docker the reason it is so powerful is because of its ability to deploy to the cloud and its containerisation.

In terms of containerisation, Docker has made it generally easier to create and deploy application via a container. The fact that everything is packaged up in this virtual shipping container means that the developer does not need to worry about he project running on a different Linux machine.

Additionally, Docker is open source! Any random person with, we can assume, a good amount of coding experience can tinker with it and adjust it to fit their own needs.

News API and Nasa Search Project

In order to run the Nasa Search Project (NSP) in Docker the first set I would suggest would be to create a file that will house your setting for the API and URL for your NSP.

Image description

In terms of the infinite X's that follow the API_KEY, I suggest you generate your key before copying your file to Docker. This can be generated by going to logging in and receiving your personalised password. The end point will also be assigned to to the second value which stands as NEWS_ENDPOINT for the example.

Once the file has been uploaded and you ensure that the data is saved in the Docker Editor you will click open port and when prompted about which port you would like to open you type in 4000.

Image description

This will take us to an unresponsive site, but will give us the public URL to our Docker file!!!!! Copy and paste this link into the NEWS_ENDPOINT value in the dev.to file.

Finally, it's time to deploy!! You're going to run docker-compose up and wait to it run-- it's going to be a while.

Once the code has run, we are going to see port 80, our frontend and 4000 our backend. Port 80 is what were looking for.

Image description

Hopefully, once you click 80 it will pull up your Nasa Search Image page, if it doesn't I'm sorry to tell you but you might have trusted the wrong IST402 student.

Top comments (0)