Skip to content

Commit

Permalink
chore: Dockerfile 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
clean2001 committed Oct 27, 2024
1 parent 3e1ecb2 commit c9c2b80
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions layer-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

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"]

0 comments on commit c9c2b80

Please sign in to comment.