Docker and Containers
Docker Engine is an extremely powerful tool that allows developers to containerize applications. Docker themselves call containers,
a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.
Containers are able to run
Getting Started With Docker
To get into using docker I first went to Play with Docker and made an account. Once you're in, you can run a new instance and create your very own Docker server.
Using Microservices and APIs in Docker
For this lab, I used Docker to create an application that displays articles from a news API. These are the steps I took:
Create a new instance in Play with Docker
Run
git clone https://github.com/heyMP/news-api-workshop && cd news-api-workshop
to clone the repo with the news API.Run
cp dot.env.example dot.env
to configure custom settings for the application.Login and get an API key from that you will put into the
dot.env
file that was created in the last step.Open port 4000 and copy the link of the page that failed to load. Paste the link in the same
dot.env
file
The file should look similar to this, except with your own API key
Run the
docker-compose up
command to run the applicationOpen port 80 and your application should come up and look like this:
Top comments (0)