File tree Expand file tree Collapse file tree 2 files changed +26
-9
lines changed Expand file tree Collapse file tree 2 files changed +26
-9
lines changed Original file line number Diff line number Diff line change 1
- FROM gcr.io/distroless/java17-debian11
2
- COPY build/libs/tms-varsel-api-all.jar app/app.jar
3
- ENV PORT=8080
4
- EXPOSE $PORT
5
- WORKDIR app
6
- CMD ["app.jar" ]
1
+ FROM ghcr.io/navikt/baseimages/temurin:21
2
+
3
+ ENV JAVA_OPTS='-XX:MaxRAMPercentage=75'
4
+
5
+ COPY build/libs/*.jar ./
Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
3
3
plugins {
4
4
kotlin(" jvm" ).version(Kotlin .version)
5
5
6
- id(Shadow .pluginId) version (Shadow .version)
7
-
8
6
application
9
7
}
10
8
@@ -55,8 +53,10 @@ dependencies {
55
53
testImplementation(Mockk .mockk)
56
54
}
57
55
56
+ val projectMainClass = " no.nav.tms.varsel.api.ApplicationKt"
57
+
58
58
application {
59
- mainClass.set(" no.nav.tms.varsel.api.ApplicationKt " )
59
+ mainClass.set(projectMainClass )
60
60
}
61
61
62
62
tasks {
@@ -70,3 +70,21 @@ tasks {
70
70
}
71
71
}
72
72
}
73
+
74
+ tasks {
75
+ withType<Jar > {
76
+ archiveBaseName.set(" app" )
77
+ manifest {
78
+ attributes[" Main-Class" ] = projectMainClass
79
+ attributes[" Class-Path" ] = configurations.runtimeClasspath.get().joinToString(separator = " " ) {
80
+ it.name
81
+ }
82
+ }
83
+ doLast {
84
+ configurations.runtimeClasspath.get().forEach {
85
+ val file = File (" ${layout.buildDirectory.get()} /libs/${it.name} " )
86
+ if (! file.exists()) it.copyTo(file)
87
+ }
88
+ }
89
+ }
90
+ }
You can’t perform that action at this time.
0 commit comments