From c9bdd0c9dde64c4f107bd4f5ee4572e21c46e7f4 Mon Sep 17 00:00:00 2001 From: Luthfi Arifin Date: Sun, 6 Oct 2024 16:46:24 +0700 Subject: [PATCH 1/4] refactor: Update Dockerfile to use 'npx nest build' for building the NestJS application --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d843398..5d2335f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ RUN pnpm install --prod COPY . . # Build the NestJS application -RUN pnpm run build +RUN npx nest build # Expose port 3000 EXPOSE 3000 From b9ec9b23ee13da2381f0cc6bd5e7aeff3b7a7101 Mon Sep 17 00:00:00 2001 From: Luthfi Arifin Date: Sun, 6 Oct 2024 16:48:14 +0700 Subject: [PATCH 2/4] refactor: Update Dockerfile to install NestJS CLI globally --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5d2335f..65c481b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,9 @@ WORKDIR /usr/src/app # Install pnpm globally RUN npm install -g pnpm +# Install NestJS CLI globally +RUN npm install -g @nestjs/cli + # Copy package.json and pnpm-lock.yaml into the container COPY package.json pnpm-lock.yaml ./ @@ -17,7 +20,7 @@ RUN pnpm install --prod COPY . . # Build the NestJS application -RUN npx nest build +RUN pnpm run build # Expose port 3000 EXPOSE 3000 From e5b8c2eae4386cfffd12aa4bb346286b58b5c307 Mon Sep 17 00:00:00 2001 From: Luthfi Arifin Date: Sun, 6 Oct 2024 16:52:16 +0700 Subject: [PATCH 3/4] refactor: Update Dockerfile to use npm instead of pnpm for installing dependencies and building the NestJS application --- Dockerfile | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 65c481b..7d18c85 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,26 +4,20 @@ FROM node:18-alpine # Set the working directory inside the container WORKDIR /usr/src/app -# Install pnpm globally -RUN npm install -g pnpm +# Copy package.json and package-lock.yaml into the container +COPY package.json ./ -# Install NestJS CLI globally -RUN npm install -g @nestjs/cli - -# Copy package.json and pnpm-lock.yaml into the container -COPY package.json pnpm-lock.yaml ./ - -# Install dependencies using pnpm -RUN pnpm install --prod +# Install dependencies using npm +RUN npm install --prod # Copy the rest of the application code into the container COPY . . # Build the NestJS application -RUN pnpm run build +RUN npm run build # Expose port 3000 EXPOSE 3000 # Start the application -CMD ["pnpm", "run", "start:prod"] +CMD ["npm", "run", "start:prod"] From b382261f12eab0c49be2d6ddee967222f0c8dfc7 Mon Sep 17 00:00:00 2001 From: Luthfi Arifin Date: Sun, 6 Oct 2024 16:55:45 +0700 Subject: [PATCH 4/4] refactor: Update Dockerfile to use pnpm instead of npm for installing dependencies and building the NestJS application --- Dockerfile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7d18c85..bc21ad6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,20 +4,23 @@ FROM node:18-alpine # Set the working directory inside the container WORKDIR /usr/src/app -# Copy package.json and package-lock.yaml into the container -COPY package.json ./ +# Install pnpm globally +RUN npm install -g pnpm -# Install dependencies using npm -RUN npm install --prod +# Copy package.json and pnpm-lock.yaml into the container +COPY package.json pnpm-lock.yaml ./ + +# Install dependencies using pnpm +RUN pnpm install # Copy the rest of the application code into the container COPY . . # Build the NestJS application -RUN npm run build +RUN pnpm run build # Expose port 3000 EXPOSE 3000 # Start the application -CMD ["npm", "run", "start:prod"] +CMD ["pnpm", "run", "start:prod"]