ModeratorElection/image/Dockerfile

39 lines
No EOL
1.2 KiB
Docker

#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
ADD resources /tmp
RUN \
--mount=type=cache,target=/var/cache/apt \
/tmp/install.sh
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
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"]