Enhance Productivity with Make: A How-To Guide

Rajesh Mishra
3 min readSep 29, 2024

Using Make and Makefile for Docker Management in a NodeJS Application

Make is a powerful build automation tool commonly used to manage the build process of software projects. It uses a file called Makefile to define a set of tasks to be executed. In this blog, we'll explore how to use Make and Makefile to manage Docker operations for a NodeJS application.

Prerequisites

Before we dive in, ensure you have the following installed on your machine:

  • Docker
  • Make — MacOS | Windows
  • NodeJS (For this, I am using NestJS Framework with Nest CLI)

Setting Up the Project

First, let’s set up a basic NestJS application. Open your terminal and run the following commands:

npm i -g @nestjs/cli
nest new makefile-demo-app
cd makefile-demo-app

This will create a new NestJS application in the makefile-demo-app directory.

Dockerizing the Application

Next, we’ll create a Dockerfile to containerize our NestJS application. Create a file named Dockerfile in the root of your project with the following content:

# Use an official Node.js runtime as a…

--

--

Rajesh Mishra

A coder by profession, sharing life experiences with the Words. Learning more about Productivity, Habits, Decision Making and ambitious towards self freedom.