Skip to content

Instantly share code, notes, and snippets.

@AngerM
Created March 23, 2021 20:54
Show Gist options
  • Save AngerM/2cdfc16314cae1f481e43b8ff997926d to your computer and use it in GitHub Desktop.
Save AngerM/2cdfc16314cae1f481e43b8ff997926d to your computer and use it in GitHub Desktop.
Kotlin Build EX
task Main(type: CreateStartScripts) {
mainClassName = 'my_main_class'
applicationName = 'my_app'
outputDir = new File(project.buildDir, 'tmp')
classpath = startScripts.classpath
}
applicationDistribution.into('bin') {
from(Main)
fileMode = 0755
applicationName = "my_app"
}
FROM gradle:jdk11 as builder
RUN mkdir /workspace
RUN chown -R gradle /workspace
USER gradle
WORKDIR /workspace
COPY . /workspace
RUN gradle test installDist --no-daemon
FROM openjdk:11-jdk-slim-buster as runner
WORKDIR /home
COPY --from=builder /workspace/build/install .
ENTRYPOINT ["/home/my_app/bin/my_app"]
EXPOSE 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment