Skip to content

Commit

Permalink
fix : docker 파일 수정
Browse files Browse the repository at this point in the history
- 도커 파일에서 빌드 환경 제거
  • Loading branch information
seokho-1116 authored and GaBaljaintheroom committed Jan 17, 2024
1 parent 25fd595 commit 9646d9f
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions backend/core/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
FROM openjdk:17-ea-slim as build
FROM eclipse-temurin:17-jre as build
WORKDIR /workspace/app

# Copy Gradle wrapper and other necessary files
COPY gradlew .
COPY gradle gradle
COPY build.gradle .
COPY settings.gradle .
COPY src src

RUN apt-get update && apt-get install -y findutils

# Execute the Gradle build
RUN ./gradlew build -x test
COPY build/libs/ .

# Unpack the built application
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../../build/libs/*.jar)
RUN mkdir -p target/extracted
RUN java -Djarmode=layertools -jar *.jar extract --destination target/extracted

FROM openjdk:17-ea-slim
FROM eclipse-temurin:17-jre
VOLUME /tmp
ARG DEPENDENCY=/workspace/app/target/dependency
ARG EXTRACTED=/workspace/app/target/extracted

# Copy over the unpacked application
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
COPY --from=build ${EXTRACTED}/dependencies/ ./
COPY --from=build ${EXTRACTED}/spring-boot-loader/ ./
COPY --from=build ${EXTRACTED}/snapshot-dependencies/ ./
COPY --from=build ${EXTRACTED}/application/ ./

# Run the application
ENTRYPOINT ["java","-cp","app:app/lib/*","site.timecapsulearchive.core.CoreApplication"]
ENTRYPOINT ["java","-Dspring.profiles.active=dev","org.springframework.boot.loader.JarLauncher"]

0 comments on commit 9646d9f

Please sign in to comment.