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