Small improvement to the layering of the Dockerfile

This commit is contained in:
Andreas Svanberg 2025-03-26 18:39:50 +01:00
parent c30ed02659
commit 77ca199b59
Signed by: ansv7779
GPG Key ID: 729B051CFFD42F92

@ -1,6 +1,12 @@
FROM eclipse-temurin:23 AS build
WORKDIR /build
# Create as small a runtime as possible but Spring/Tomcat needs a lot of modules
RUN jlink \
--output jre \
--add-modules java.sql,java.desktop,java.management,java.naming,java.security.jgss,java.instrument
COPY pom.xml mvnw ./
COPY .mvn .mvn
@ -19,11 +25,6 @@ COPY src src
RUN ./mvnw compile
# Create as small a runtime as possible but Spring/Tomcat needs a lot of modules
RUN jlink \
--output jre \
--add-modules java.sql,java.desktop,java.management,java.naming,java.security.jgss,java.instrument
FROM debian:stable-slim AS runtime
WORKDIR /app