Development Environment with Docker

Nitin sreeram
Jan 26, 2018 · 5 min read

What is Docker?

What are the benefits of using it in the Development environment?

How to set it up?

docker run -d -p 8000:80 nginx
docker psCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                  NAMES
cf927d64e40b nginx "nginx -g 'daemon ..." 11 minutes ago Up 11 minutes 0.0.0.0:8000->80/tcp focused_mcnulty
docker kill focused_mcnulty
FROM node:8.4WORKDIR /usr/src/app
ADD . /usr/src/app
CMD npm start
docker build -t nitinsreeram/my-node-app .
docker imagesREPOSITORY              TAG        IMAGE ID         CREATED       VIRTUAL SIZE
nginx latest 07f8e8c5e660 2 weeks ago 188.3 MB
nitinsreeram/my-node-app latest 2ac5d95f10cc 4 hours ago 123 MB
version: '2'services:api:build: .working_dir: /appcommand: npm run start:devvolumes:- .:/app- ./logs:/var/logs/appports:- "8000:80"- "9229:9229"links:- mongodbenv_file: .envenvironment:- USERmongodb:image: mongo:3.4ports:- "27017:27017"env_file: .env
docker-compose up
docker-compose down

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade