-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (28 loc) ยท 825 Bytes
/
Copy pathDockerfile
File metadata and controls
39 lines (28 loc) ยท 825 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
35
36
37
38
39
# Build stage
FROM eclipse-temurin:21-jdk AS build
WORKDIR /app
# Gradle wrapper์ build ํ์ผ ๋ณต์ฌ
COPY gradlew .
COPY gradle gradle
COPY build.gradle .
COPY settings.gradle .
# ์์ค ์ฝ๋ ๋ณต์ฌ
COPY src src
# ๋น๋ ์คํ
RUN chmod +x ./gradlew
RUN ./gradlew clean build -x test
# Runtime stage
FROM eclipse-temurin:21-jre
WORKDIR /app
# ๋น๋ ๊ฒฐ๊ณผ๋ฌผ๋ง ๋ณต์ฌ
COPY --from=build /app/build/libs/*.jar app.jar
# ์๊ฐ๋ ์ค์
ENV TZ=Asia/Seoul
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# ํฌํธ ๋
ธ์ถ
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
# ์คํ
ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=prod", "-Xmx512m", "-Xms256m", "app.jar"]