HOME

Dockerize your Development Environment for NodeJS

Using Docker in your development workflow has a positive impact on your productivity.

What is Docker?

Docker is a platform that can run containers, packages of software. To run these containers Docker uses OS-level virtualization .you can think of a container as a lightweight version of a virtual machine. Docker is a tool for creating and managing lightweight virtualized environments which can be used to deploy and other applications. 

WORKDIR

sets the directory in which all the upcoming commands will be executed.

COPY

does exactly what it says, it gets the package.json and package- lock.json and copies it to the WORKDIR.

ENV

sets an environment variable inside the container with the name PORT and the value 5000

Why would you dockerize your development workflow?

Tools I use for Web Development

Notion

I tried out a lot of different tools but none of them had the flexibiity and customizability 

GitHub

It has a nice and clean user interface and it lets you import an existing repository.

Endpoint and Custom Middleware

{ 
 
  “name”express_api_template, 
 
  “version”“1.0.0”, 
 
  “description”“”, 
 
  “main”src/server.js”, 
 
  “scripts”: { 
 
    “start”“NODE_ENV=production node src/server.js”, 
 
    “dev”“NODE_ENV=development nodemon src/server.js” 
 
  }, 
 
  “author”“Jakob Klamser, 
“license”“ISC”, 
 
  “dependencies”: { 
 
    “colors”“^1.4.0”, 
 
    dotenv“^8.2.0”, 
 
    “express”“^4.17.1” 
 
  }, 
 
  devDependencies: { 
 
    nodemon“^2.0.4” 
 
  } 
 
} 

Copyright @2023 . klamser  . All Rights Reserved .