2024-07-11 19:35:08 +00:00
|
|
|
#buildJar-stage
|
|
|
|
FROM openjdk:22-jdk-slim as build-jar-stage
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
--mount=type=cache,target=/var/cache/apt \
|
2024-07-12 11:14:37 +00:00
|
|
|
apt-get update && apt-get -qqy upgrade
|
|
|
|
ADD ./ /usr/local/src/ModeratorElection
|
2024-07-11 19:35:08 +00:00
|
|
|
WORKDIR /usr/local/src/ModeratorElection/
|
|
|
|
RUN ./gradlew build -Pvaadin.productionMode
|
|
|
|
|
|
|
|
# Run jar stage
|
|
|
|
FROM build-jar-stage AS run-jar-stage
|
|
|
|
EXPOSE 8080
|
|
|
|
WORKDIR /usr/local/src/ModeratorElection/build/libs/
|
|
|
|
RUN chmod 0740 ./ModeratorElection.jar
|
|
|
|
ENTRYPOINT ["java", "-jar", "./ModeratorElection.jar"]
|
|
|
|
|
2024-07-12 11:14:37 +00:00
|
|
|
FROM build-jar-stage AS ci-image-stage
|
2024-07-18 09:13:54 +00:00
|
|
|
RUN chmod 0740 ./build/libs/ModeratorElection.jar
|
|
|
|
ENTRYPOINT ["java", "-jar", "./build/libs/ModeratorElection.jar"]
|
2024-07-11 19:35:08 +00:00
|
|
|
|
|
|
|
#build-native-stage
|
|
|
|
FROM ubuntu:latest as build-native-stage
|
2024-06-13 20:20:25 +00:00
|
|
|
|
2024-07-12 11:14:37 +00:00
|
|
|
ADD image/resources /tmp
|
2024-07-11 19:35:08 +00:00
|
|
|
RUN \
|
|
|
|
--mount=type=cache,target=/var/cache/apt \
|
|
|
|
/tmp/install.sh
|
2024-06-20 13:09:08 +00:00
|
|
|
ENV LANG=en_US.UTF-8 \
|
2024-07-11 19:35:08 +00:00
|
|
|
JAVA_HOME=/usr/lib/jvm/graalvm/bin
|
2024-06-20 20:05:15 +00:00
|
|
|
|
2024-07-11 19:35:08 +00:00
|
|
|
# Run native binary stage
|
|
|
|
FROM build-native-stage AS run-native-stage
|
2024-06-20 20:05:15 +00:00
|
|
|
|
2024-06-28 08:23:02 +00:00
|
|
|
EXPOSE 8080
|
2024-07-11 19:35:08 +00:00
|
|
|
#CMD ["mkdir /usr/local/src/ModeratorElection"]
|
|
|
|
WORKDIR /usr/local/src/ModeratorElection/build/native/nativeCompile/
|
|
|
|
##copy native binary
|
|
|
|
#COPY --from=buildNative-stage /usr/local/src/ModeratorElection/build/native/nativeCompile/ .
|
2024-06-25 05:46:00 +00:00
|
|
|
RUN chmod 0740 ./ModeratorElection
|
2024-07-11 19:35:08 +00:00
|
|
|
ENTRYPOINT ["./ModeratorElection"]
|