Docker/-compose

This commit is contained in:
Marvin Scham
2023-06-24 23:34:13 +00:00
parent cb757035a2
commit 3a1450dade
7 changed files with 106 additions and 16 deletions

28
Dockerfile Normal file
View File

@@ -0,0 +1,28 @@
# Use the official maven/Java 17 image to create a build artifact.
# https://hub.docker.com/_/maven
FROM maven:3.9.1-eclipse-temurin-17 AS build
# Set the working directory in the image to /app
WORKDIR /app
# Copy the pom.xml file into the current directory (/app) in the image
COPY pom.xml .
# Download all required dependencies into one layer
RUN mvn -B dependency:go-offline
# Copy the rest of the application source code
COPY src /app/src
# Build the application
RUN mvn -B package -DskipTests
# Use OpenJDK 17 for the runtime stage of the Dockerfile
FROM openjdk:17-jdk-slim
# Copy the jar file from the build stage
COPY --from=build /app/target/easydrop-0.3.0-SNAPSHOT.jar /easydrop.jar
# Execute the application when the docker container starts.
ENTRYPOINT ["java", "-jar", "/easydrop.jar"]