From 0c02cdbf3f1f37c98e62a7264598fd7f795b06a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Sun, 29 Oct 2023 12:08:01 +0100 Subject: [PATCH] Fix docker multistage build --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index afa3f44..6659b62 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ -FROM node:21 -WORKDIR /home/gradle/src/app +FROM node:21 as fronted +COPY --chown=node:node . /home/node/src +WORKDIR /home/node/src/app RUN npm install && npm run build FROM gradle:7-jdk11 AS build -COPY --chown=gradle:gradle . /home/gradle/src +COPY --from=fronted --chown=gradle:gradle /home/node/src /home/gradle/src WORKDIR /home/gradle/src RUN gradle buildFatJar --no-daemon