From 7433bc2f4eb78d9793084d5cf3b7e38dc673b6d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20BENO=C3=8ET?= Date: Fri, 3 Jan 2025 15:20:34 +0100 Subject: [PATCH] chore: simplify backend build stage --- docker/Dockerfile.backend | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile.backend b/docker/Dockerfile.backend index af1a301..7022770 100644 --- a/docker/Dockerfile.backend +++ b/docker/Dockerfile.backend @@ -2,14 +2,12 @@ FROM maven:3-jdk-7 AS build ENV BUILD_UID=1000 ENV BUILD=/src ENV MAVEN_HOME=/var/maven -ENV MAVEN_CONFIG=/var/maven/.m2 RUN mkdir -p $MAVEN_HOME && chown $BUILD_UID $MAVEN_HOME -RUN mkdir -p $BUILD -ADD .. $BUILD -RUN chown -R $BUILD_UID $BUILD +ADD --chown=$BUILD_UID:$BUILD_UID .. $BUILD USER $BUILD_UID WORKDIR $BUILD -RUN --mount=type=cache,target=$MAVEN_HOME/.m2,uid=$BUILD_UID mvn -e -Duser.home=$MAVEN_HOME package +RUN --mount=type=cache,target=$MAVEN_HOME/.m2,uid=$BUILD_UID \ + mvn -e -Duser.home=$MAVEN_HOME package FROM openjdk:7u211-jre-alpine RUN <