-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (20 loc) ยท 905 Bytes
/
Copy pathDockerfile
File metadata and controls
28 lines (20 loc) ยท 905 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
# --- Build stage ---
FROM gradle:8.2.1-jdk11 AS build
WORKDIR /app
COPY build.gradle settings.gradle ./
COPY gradle ./gradle
COPY gradlew ./
COPY src ./src
# ๋ก์ปฌ/๋ชจ๋ํฐ๋ง ๊ฒ์ฆ์ฉ application.yml์ build context ๋ฃจํธ์ ๋๊ณ ๋ณต์ฌํ๋ค.
# (CI/CD์์๋ GitHub Secret์ผ๋ก ๋ณ๋ ์์ฑ โ ์ด Dockerfile์ ๋ก์ปฌ ๊ฒ์ฆ ์ ์ฉ)
COPY application.yml ./application.yml
RUN ./gradlew bootJar -x test --no-daemon
# --- Run stage ---
FROM eclipse-temurin:11-jre
WORKDIR /app
COPY --from=build /app/build/libs/*.jar app.jar
COPY --from=build /app/application.yml application.yml
EXPOSE 8080
# dev(Render Free tier, 512MB)๋ ๋ฉ๋ชจ๋ฆฌ ์ฌ์ ๊ฐ ์์ด OTel agent๋ฅผ ๋บ๋ค.
# prod๋ CD๊ฐ ์ด Dockerfile์ ์ฐ์ง ์์ผ๋ฏ๋ก(๋ณ๋ CodeDeploy) ์ํฅ ์์.
ENTRYPOINT ["java", "-Duser.timezone=Asia/Seoul", "-jar", "app.jar", "--spring.config.location=file:./application.yml"]