Skip to content

Commit

Permalink
chore: jib 파라미터 추가 (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddingmin authored May 28, 2024
1 parent dc88bca commit 2f446a8
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,35 @@ tasks.withType<Test> {
springBoot {
buildInfo()
}

jib {
val activeProfile: String? = System.getenv("SPRING_PROFILES_ACTIVE")
val imageName: String? = System.getenv("IMAGE_NAME")
val imageTag: String? = System.getenv("IMAGE_TAG")
val serverPort: String = System.getenv("SERVER_PORT") ?: "8080"
from {
image = "amazoncorretto:17-alpine3.17-jdk"
}
to {
image = imageName
tags = setOf(imageTag, "latest")
}
container {
jvmFlags =
listOf(
"-Dspring.profiles.active=$activeProfile",
"-Dserver.port=$serverPort",
"-Djava.security.egd=file:/dev/./urandom",
"-Dfile.encoding=UTF-8",
"-Duser.timezone=Asia/Seoul",
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UseContainerSupport",
"-XX:+UseG1GC",
// "-XX:InitialHeapSize=2g",
// "-XX:MaxHeapSize=2g", // 프리티어니까... vm아 괜찮을 만큼만 적당히 할당해봐...
"-XX:+DisableExplicitGC", // System.gc() 방어
"-server",
)
ports = listOf(serverPort)
}
}

0 comments on commit 2f446a8

Please sign in to comment.