itse-presentation/Dockerfile

18 lines
471 B
Docker

FROM maven:4.0.0-rc-4-eclipse-temurin-21-alpine AS build
WORKDIR /app
# separate dependency stage to reduce build time when dependencies are unchanged
COPY pom.xml .
RUN mvn dependency:go-offline -B
COPY src ./src
# issues when not skipping, idk why
RUN mvn clean package -DskipTests
# openjdk is now deprecated over temurin
FROM eclipse-temurin:21-jre-alpine
WORKDIR /app
COPY --from=build /app/target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]