CatgirlIntelligenceAgency/docker-service.gradle
Viktor Lofgren b83bb5a48a (docker) Upgrade to jdk20 image to fix weird mojibake problems.
Super weird encoding bug that only arises on versions below jdk18 causing crawl data to be read incorrectly.

Seems possibly related to the new standard charset of UTF-8. Maybe some library (unknown which) is attempting to be backwards compatible in a way that totally breaks?
2023-08-19 10:58:47 +02:00

47 lines
1.2 KiB
Groovy

ext {
dockerImage='openjdk:20-slim'
serviceJvmOpts='-Dservice-host=0.0.0.0 -ea ${wmsa_jvm_param} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=4000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false'
serviceToolOpts='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5000'
}
tasks.register('dockerFile') {
buildDir.mkdir()
var df = new File(buildDir, "Dockerfile")
doLast {
df.text = """#
# I'm auto-generated, please don't make changes to me or commit me to git
#
# The template exists in docker-service.gradle
#
FROM ${dockerImage}
ADD ${application.applicationName}.tar /
RUN mkdir /wmsa
ENV JAVA_TOOL_OPTIONS="${serviceToolOpts}"
ENV JAVA_OPTS="${serviceJvmOpts} "
ENTRYPOINT WMSA_HOME=/wmsa /${application.applicationName}/bin/${application.applicationName} \${arg0} \${arg1}
"""
}
it.outputs.file(df)
}
dockerPrepare {
dependsOn tasks.dockerFile
}
dockerfileZip {
dependsOn tasks.dockerFile
}
docker {
dockerfile = tasks.dockerFile.outputs.files.singleFile
name = 'marginalia.nu/'+application.applicationName+':latest'
files tasks.distTar.outputs
tags 'latest'
dependsOn tasks.distTar
}