|
1 | | -FROM gradle:8.13.0-jdk23-alpine AS build |
2 | | -# Note: the gradle version must match the version in build.gradle.kts |
| 1 | +FROM gradle:8.14.0-jdk21-alpine AS build |
3 | 2 | COPY --chown=gradle:gradle . /home/gradle/src |
4 | 3 | WORKDIR /home/gradle/src |
5 | | -RUN echo "Contents of workdir:" && ls -l . \ |
6 | | - && gradle build --no-daemon -x test \ |
7 | | - && echo "Build complete, contents of build/libs:" && ls -l build/libs \ |
8 | | - && rm build/libs/*-plain.jar \ |
9 | | - && echo "Contents of build/libs after removing plain jars:" && ls -l build/libs |
10 | | - |
11 | | -FROM eclipse-temurin:23.0.2_7-jre-alpine-3.21 |
| 4 | +RUN gradle build -x test |
12 | 5 |
|
| 6 | +FROM eclipse-temurin:21.0.7_6-jre-alpine-3.21 |
13 | 7 | EXPOSE 8010:8080 |
14 | | -COPY --from=build /home/gradle/src/build/libs/*.jar galahad-server.jar |
15 | | -COPY --from=build /home/gradle/src/application.properties application.properties |
16 | | - |
17 | | -COPY /data ./data |
18 | | - |
19 | | -# -Dlog4j2.formatMsgNoLookups=true is to mitigate log4j zero-day, which we are probably vulnerable to since we use |
20 | | -# https://logging.apache.org/log4j/kotlin/ , however it is not clear how to updrage log4j itself whilst keep using the kotlin wrapper |
21 | | -# Therefore we use a mitigation noted here: https://github.com/advisories/GHSA-jfh8-c2jp-5v3q |
22 | | -# It can be removed once we have ensured the log4j verion is properly upgraded |
23 | | -# We start with a big heap size to avoid OOM on large documents |
24 | | -ENTRYPOINT ["java", "-Xms4g", "-Xmx8g", "-Dspring.profiles.active=prod", "-Dlog4j2.formatMsgNoLookups=true", "-Djava.security.egd=file:/dev/./urandom","-jar","galahad-server.jar"] |
| 8 | +COPY --link --from=build /home/gradle/src/build/libs/galahad.jar /home/gradle/src/application.properties ./ |
| 9 | +ENTRYPOINT ["java", "-Xms4g", "-Xmx8g", "-Dspring.profiles.active=prod", "-jar","galahad.jar"] |
0 commit comments