From 9960e053153e0945688a149d62589ed64a38afff Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Wed, 25 Jun 2025 17:11:45 +0200 Subject: [PATCH] Refactor Dockerfile to unify base image references and improve clarity in build stages --- Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 60acf74..8da48d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,27 @@ # Base Stage for NodeJS -FROM node:22-alpine AS base +FROM --platform=$BUILDPLATFORM node:22-alpine AS buildhelper ENV NODE_ENV=docker WORKDIR /usr/src/app # Installing dependencies with use of package-lock.json -FROM base AS deps +FROM buildhelper AS deps RUN apk --no-cache add git COPY homebrewery/package.json homebrewery/package-lock.json ./ RUN npm ci --ignore-scripts # Build Stage -FROM base AS builder +FROM buildhelper AS builder COPY --from=deps /usr/src/app/node_modules ./node_modules COPY homebrewery/ ./ RUN npm run build -FROM base AS runner +FROM --platform=$TARGETPLATFORM node:22-alpine AS runner + +ENV NODE_ENV=docker +WORKDIR /usr/src/app ARG VERSION ARG REVISION