From c9c2b80d9eb672cdf7346261de3837b7faf14f56 Mon Sep 17 00:00:00 2001 From: Sejeong Kim Date: Sun, 27 Oct 2024 12:55:07 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20Dockerfile=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layer-api/Dockerfile | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/layer-api/Dockerfile b/layer-api/Dockerfile index 6f09d5f5..5f4cbda6 100644 --- a/layer-api/Dockerfile +++ b/layer-api/Dockerfile @@ -1,10 +1,31 @@ -FROM openjdk:17 +#FROM openjdk:17 +# +#ARG JAR_FILE=./build/libs/*.jar +#ARG SPRING_PROFILE +# +#COPY ${JAR_FILE} layer-server.jar +# +#ENV SPRING_PROFILE=${SPRING_PROFILE} +# +#ENTRYPOINT ["java", "-Duser.timezone=Asia/Seoul","-Dspring.profiles.active=aws" ,"-jar" ,"layer-server.jar"] + + -ARG JAR_FILE=./build/libs/*.jar -ARG SPRING_PROFILE=aws +FROM openjdk:17 as stage1 +WORKDIR /app +COPY gradlew . +COPY gradle gradle +COPY src src +COPY build.gradle . +COPY settings.gradle . -COPY ${JAR_FILE} layer-server.jar +RUN chmod 777 ./gradlew +RUN ./gradlew bootJar -ENV SPRING_PROFILE=${SPRING_PROFILE} -ENTRYPOINT ["java", "-Duser.timezone=Asia/Seoul","-Dspring.profiles.active=aws" ,"-jar" ,"layer-server.jar"] \ No newline at end of file + +FROM openjdk:17 +WORKDIR /app +COPY --from=stage1 /app/build/libs/*.jar app.jar + +ENTRYPOINT ["java", "-Duser.timezone=Asia/Seoul","-Dspring.profiles.active=aws" ,"-jar" ,"app.jar"] \ No newline at end of file