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 \
|
|
|
|
apt-get update && apt-get -qqy upgrade &&\
|
|
|
|
apt-get -qqy install git &&\
|
|
|
|
git clone --single-branch --branch main https://repo.prod.meissa.de/meissa/ModeratorElection.git /usr/local/src/ModeratorElection
|
|
|
|
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"]
|
|
|
|
|
|
|
|
|
|
|
|
#build-native-stage
|
|
|
|
FROM ubuntu:latest as build-native-stage
|
2024-06-13 20:20:25 +00:00
|
|
|
|
|
|
|
ADD 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"]
|