Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers.
Getting my hands dirty with docker.
This project is my way of exploring docker.
Primary sources of references were
Running on local system
- Clone the repo using the
--recursive
flag to ensure that the submodule is also cloned - Assuming docker is installed and running in your system use
docker-compose up
from the root directory of the project - Visit localhost:3000, localhost:4000 and localhost:5000 on your browser.
Learnings
- Basic concepts of docker
- Configuring Dockerfile
- Building images
- Optimising build speed using layer caching
- Mapping volumes
- Creating and running containers
- Using docker compose to define and spin up multiple containerised applications at once
- Sharing docker images via docker hub
Dockerfile
Dockerfile: A text document that contains all the commands a user could call on the command line to assemble an image
- Head over to the dockerphile submodule.
- Changes to the Dockerfile are explained through comments
-
We also write Dockerfiles for two other apps
- A Express API backend (api)
- A React app that reads data from the backend (myblog)
Docker Compose
Docker Compose: A tool that was developed to help define and share multi-container applications. With Compose, we can create a YAML file to define the services and with a single command, can spin everything up or tear it all down
- We define services in the docker-compose file and spin up all our applications at once using the
docker-compose up
command