ModeratorElection/Dockerfile

41 lines
1.2 KiB
Docker
Raw Permalink Normal View History

#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
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"]
#build-native-stage
FROM ubuntu:latest as build-native-stage
2024-07-12 11:14:37 +00:00
ADD image/resources /tmp
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 \
JAVA_HOME=/usr/lib/jvm/graalvm/bin
# Run native binary stage
FROM build-native-stage AS run-native-stage
2024-06-28 08:23:02 +00:00
EXPOSE 8080
#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/ .
RUN chmod 0740 ./ModeratorElection
ENTRYPOINT ["./ModeratorElection"]