From ecdb66706e1351a9c98faf46447c010b9022ebc7 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Sat, 5 Sep 2020 12:02:34 -0700 Subject: [PATCH] Add docker deployments with caprover Signed-off-by: William Brawner --- Dockerfile | 12 ++++++++++++ captain-definition | 4 ++++ server/build.gradle | 4 ++++ 3 files changed, 20 insertions(+) create mode 100644 Dockerfile create mode 100644 captain-definition diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6fa22a7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM openjdk:14-jdk as builder +MAINTAINER William Brawner + +RUN mkdir -p /home/gradle +COPY . /home/gradle/src +WORKDIR /home/gradle/src +RUN /home/gradle/src/gradlew --console=plain --no-daemon server:bootJar + +FROM openjdk:14-jdk-slim +EXPOSE 8080 +COPY --from=builder /home/gradle/src/server/build/libs/flayre-server.jar flayre-server.jar +CMD /usr/local/openjdk-14/bin/java $JVM_ARGS -jar /flayre-server.jar diff --git a/captain-definition b/captain-definition new file mode 100644 index 0000000..17db556 --- /dev/null +++ b/captain-definition @@ -0,0 +1,4 @@ + { + "schemaVersion": 2, + "dockerfilePath": "./Dockerfile" + } diff --git a/server/build.gradle b/server/build.gradle index de94eb5..bdd7c90 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -10,6 +10,10 @@ repositories { mavenCentral() } +bootJar { + archiveFileName = "flayre-server.${archiveExtension.get()}" +} + dependencies { implementation project(':shared') implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'