Skip to content

Commit

Permalink
Add Dockerfile & modify build.gradle to build jar
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoi15A committed Jan 31, 2023
1 parent d5d94f6 commit 5314213
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM eclipse-temurin:17-jre

COPY ./build/libs/Guildmaster*.jar /opt/app/Guildmaster.jar

CMD ["java", "-jar", "/opt/app/Guildmaster.jar"]
11 changes: 11 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,14 @@ tasks.withType<KotlinCompile> {
application {
mainClass.set("MainKt")
}

// Pack dependencies - https://www.jetbrains.com/help/idea/create-your-first-kotlin-app.html#package-as-jar
tasks.jar {
manifest {
attributes["Main-Class"] = "MainKt"
}
configurations["compileClasspath"].forEach { file: File ->
from(zipTree(file.absoluteFile))
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

0 comments on commit 5314213

Please sign in to comment.