From 4674ddfe8b935a03d7b6003d0b0b0cfe76459128 Mon Sep 17 00:00:00 2001 From: Angelo Reale <12191809+angeloreale@users.noreply.github.com> Date: Sat, 24 Aug 2024 14:01:38 +0100 Subject: [PATCH] ar(feat) [DPTM-8] Dockerize and GCP --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d485bfa..6c05e50 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM node:20 AS base +FROM node:20-alpine AS base # Install dependencies only when needed FROM base AS deps # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. -# RUN apk add --no-cache libc6-compat +RUN apk add --no-cache libc6-compat WORKDIR /app ARG NEXUS_STANDALONE @@ -23,8 +23,6 @@ RUN \ else echo "Lockfile not found." && exit 1; \ fi -RUN npm i -g pm2 - # Rebuild the source code only when needed FROM base AS builder WORKDIR /app @@ -134,6 +132,8 @@ RUN adduser --system --uid 1001 nextjs COPY --from=builder /app/public ./public +RUN npm i -g pm2 + # Set the correct permission for prerender cache RUN mkdir .next RUN chown nextjs:nodejs .next