From 53142135e16c9aecf2826d88007a5688e91bd603 Mon Sep 17 00:00:00 2001 From: Austin Albrecht Date: Wed, 1 Feb 2023 00:03:21 +0100 Subject: [PATCH] Add Dockerfile & modify build.gradle to build jar --- Dockerfile | 5 +++++ build.gradle.kts | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5520f42 --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/build.gradle.kts b/build.gradle.kts index 9b71598..5a2ddd5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -32,3 +32,14 @@ tasks.withType { 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 +}