Skip to content

Commit

Permalink
fix dockerignore
Browse files Browse the repository at this point in the history
  • Loading branch information
NikkyAI committed Sep 4, 2024
1 parent 1800c8e commit e74be6b
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 31 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
!/src/**
!/build/libs/application.jar
!/build.gradle.kts
!/gradle.properties
!/gradlew
!/settings.gradle.kts
!/version_key_rules.txt
Expand Down
31 changes: 16 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
21 changes: 14 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,22 @@ dependencies {
}

java {
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
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<org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask> {
// compilerOptions {
// jvmTarget = "16"
// }
//}

tasks {
test {
useJUnitPlatform()
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down

0 comments on commit e74be6b

Please sign in to comment.