From e74be6b3b07e66d41b2fb352c155b32b6503654b Mon Sep 17 00:00:00 2001 From: nikky Date: Wed, 4 Sep 2024 08:38:39 +0200 Subject: [PATCH] fix dockerignore --- .dockerignore | 1 + .gitignore | 31 ++++++++++++------------ Dockerfile | 16 ++++++------ build.gradle.kts | 21 ++++++++++------ gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 2 +- 6 files changed, 42 insertions(+), 31 deletions(-) diff --git a/.dockerignore b/.dockerignore index c7d4050..0647e8a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,6 +4,7 @@ !/src/** !/build/libs/application.jar !/build.gradle.kts +!/gradle.properties !/gradlew !/settings.gradle.kts !/version_key_rules.txt diff --git a/.gitignore b/.gitignore index 44ffb8e..5593333 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,16 @@ -.idea/ -out/ -.gradle/ -build/ - -/data/ -/config/ -/logs/ -/run -/colors - -.env -buildscan.log - -results/ +.idea/ +out/ +.gradle/ +build/ + +/data/ +/config/ +/logs/ +/run +/colors + +.env +buildscan.log + +results/ +*.hprof diff --git a/Dockerfile b/Dockerfile index d250193..3eceb63 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,21 @@ -FROM gradle:8-jdk21-alpine AS build +FROM gradle:8.10-jdk21 AS build COPY --chown=gradle:gradle . /home/gradle/src WORKDIR /home/gradle/src -RUN gradle :shadowJar --no-daemon +# RUN ls -la /home/gradle/src && gradle -Pksp.useKSP2=true clean :shadowJar --no-daemon +RUN gradle :shadowJar +# RUN ./gradlew clean :shadowJar -FROM amazoncorretto:21-alpine AS runtime +FROM amazoncorretto:21 AS runtime RUN mkdir /app -RUN addgroup -S user -g 1000 && \ - adduser -S user -G user --uid 1000 -USER user:user +# RUN addgroup -S user -g 1000 && \ +# useradd -S user -G user --uid 1000 +# USER user:user COPY --from=build --chown=user:user /home/gradle/src/build/libs/application.jar /app/application.jar ENV DOCKER_LOGGING="true" ENV JVM_OPTS="-XX:MaxRAMPercentage=75.0" -ENTRYPOINT java $JVM_OPTS -jar /app/application.jar +ENTRYPOINT ["java", "$JVM_OPTS", "-jar", "/app/application.jar"] diff --git a/build.gradle.kts b/build.gradle.kts index 3417332..42e81e5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -71,15 +71,22 @@ dependencies { } java { - sourceCompatibility = JavaVersion.VERSION_16 - targetCompatibility = JavaVersion.VERSION_16 -} -tasks.withType { - kotlinOptions { - jvmTarget = "16" - } +// sourceCompatibility = JavaVersion.VERSION_16 +// targetCompatibility = JavaVersion.VERSION_16 } +//tasks.named("compileKotlin", org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask::class.java) { +// compilerOptions { +// freeCompilerArgs.add("-Xexport-kdoc") +// } +//} + +//tasks.withType { +// compilerOptions { +// jvmTarget = "16" +// } +//} + tasks { test { useJUnitPlatform() diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 509c4a2..707e499 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 89f4056..ba1b3a8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -7,7 +7,7 @@ pluginManagement { } plugins { - id("com.gradle.develocity") version "3.18" + id("com.gradle.develocity") version "3.17" id("de.fayard.refreshVersions") version "0.60.5" }