Docker is used to virtualize a development environment so that everyone has the same tools, software, and running source code.
Host: Your computer (macOS).
Guest: The virtual machine (and any containers inside of it).
-
Have the environment start up identically everytime.
$ docker-compose build ... $ docker-compose up
-
Be able to SSH into guest operating system so I can interact with or debug things.
docker exec -it app bash
-
Have the files on my host filesystem so my IDE can work with them.
-
When I make file changes, automatically restart the application so that development is seamless.
- I don't have to deploy code locally.
-
Have the same OS and configuration on development and remote environments (more on this later in docker-p2-deployment).
- No more "it works on my computer" scenarios.
See the included docker-compose.yml
, Dockerfile
, and app.js
.