-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (23 loc) · 797 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (23 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Stage 1: Dependencies
FROM gradle:8.4.0-jdk17 AS dependencies
WORKDIR /build
COPY gradlew .
# COPY gradle.properties /root/.gradle/gradle.properties
COPY gradle/wrapper/gradle-wrapper.jar gradle/wrapper/
COPY gradle/wrapper/gradle-wrapper.properties gradle/wrapper/
COPY build.gradle settings.gradle ./
RUN ./gradlew dependencies --no-daemon
# Stage 2: Build
FROM gradle:8.4.0-jdk17 AS builder
WORKDIR /build
COPY --from=dependencies /build /build
COPY src src
COPY config config
RUN ./gradlew bootJar -x test --build-cache --no-daemon
# Stage 3: Final Image
FROM amazoncorretto:17
ENV TZ=Asia/Seoul
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
WORKDIR /app
COPY --from=builder /build/build/libs/*.jar app.jar
ENTRYPOINT ["java", "-jar", "/app/app.jar"]