-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (23 loc) · 802 Bytes
/
Dockerfile
File metadata and controls
34 lines (23 loc) · 802 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
34
# Stage 1: Dependencies
FROM gradle:8.4.0-jdk17 AS dependencies
WORKDIR /build
COPY gradlew .
RUN chmod +x 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
RUN ./gradlew bootJar -x test --build-cache --no-daemon
# Stage 3: Final Image
FROM openjdk:17-jdk-slim
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"]