-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
26 lines (17 loc) · 937 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Builder stage: Use gradle image to compile jar file
FROM gradle:jdk11 AS builder
WORKDIR /app
COPY . .
WORKDIR /app/receipt
RUN ./gradlew build
RUN ./gradlew publishToMavenLocal
WORKDIR /app/isajson-biosamples
RUN ./gradlew build -x test -x spotlessApply --info --stacktrace "-Dorg.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"
# Use a lightweight base image to run the jar file
FROM openjdk:11-jre-slim
WORKDIR /app
ARG JAR_FILE=/app/isajson-biosamples/build/libs/*.jar
# Copy the JAR file from the builder stage
COPY --from=builder ${JAR_FILE} app.jar
# Set the entry point for the application
ENTRYPOINT ["java", "-jar", "app.jar"]