From baa5d39dd462b5d7ced708156a3afdabd6f0a9d8 Mon Sep 17 00:00:00 2001 From: Braydon Date: Wed, 31 May 2023 22:32:42 -0400 Subject: [PATCH] Document Dockerfile --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Dockerfile b/Dockerfile index 9922b5f..90195c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,29 @@ +# Stage 1: Building FROM maven:3.8.5-openjdk-17-slim AS builder + +# Set the work dir inside the container WORKDIR /app + +# Copy the POM file to the work dir COPY pom.xml . + +# Copy src to the work dir COPY src ./src + +# Run Maven to clean and package the app RUN mvn clean package -T12 +# Stage 2: Running FROM openjdk:17.0.1-jdk-slim + +# Set the work dir inside the container WORKDIR /usr/local/app + +# Copy the compiled JAR file from the builder stage to the work dir COPY --from=builder /app/target/LicenseServer.jar . + +# Expose the port EXPOSE 7500 + +# Set the command to run the app when the container starts CMD ["java", "-jar", "LicenseServer.jar"] \ No newline at end of file