diff --git a/.github/workflows/native-image.yml b/.github/workflows/native-image.yml index bd252ca..d280a67 100644 --- a/.github/workflows/native-image.yml +++ b/.github/workflows/native-image.yml @@ -56,6 +56,7 @@ jobs: - official-bots - rule - store + - tournament - ws arch: - name: default diff --git a/.gitignore b/.gitignore index ff6f7e7..bb73397 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,7 @@ modules/account/src/main/resources/keys/dev-private.pem modules/account/src/main/resources/keys/dev-public.pem modules/core/src/main/resources/keys/dev-public.pem *.hprof + +### Embedded repos (not submodules) ### +GitOps/ +frontend/ diff --git a/modules/tournament/src/main/docker/Dockerfile.jvm b/modules/tournament/src/main/docker/Dockerfile.jvm new file mode 100644 index 0000000..a268e07 --- /dev/null +++ b/modules/tournament/src/main/docker/Dockerfile.jvm @@ -0,0 +1,36 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# ./gradlew build +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/tournament-jvm . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/tournament-jvm +# +# This image uses the `run-java.sh` script to run the application. +# You can find more information about the UBI base runtime images and their configuration here: +# https://rh-openjdk.github.io/redhat-openjdk-containers/ +### +FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.24 + +ENV LANGUAGE='en_US:en' + + +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY --chown=185 build/quarkus-app/lib/ /deployments/lib/ +COPY --chown=185 build/quarkus-app/*.jar /deployments/ +COPY --chown=185 build/quarkus-app/app/ /deployments/app/ +COPY --chown=185 build/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8080 +USER 185 +ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" + +ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ] diff --git a/modules/tournament/src/main/docker/Dockerfile.legacy-jar b/modules/tournament/src/main/docker/Dockerfile.legacy-jar new file mode 100644 index 0000000..cc21b38 --- /dev/null +++ b/modules/tournament/src/main/docker/Dockerfile.legacy-jar @@ -0,0 +1,33 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# ./gradlew build -Dquarkus.package.jar.type=legacy-jar +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/tournament-legacy-jar . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/tournament-legacy-jar +# +# This image uses the `run-java.sh` script to run the application. +# You can find more information about the UBI base runtime images and their configuration here: +# https://rh-openjdk.github.io/redhat-openjdk-containers/ +### +FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.24 + +ENV LANGUAGE='en_US:en' + + +COPY build/lib/* /deployments/lib/ +COPY build/*-runner.jar /deployments/quarkus-run.jar + +EXPOSE 8080 +USER 185 +ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" + +ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ] diff --git a/modules/tournament/src/main/docker/Dockerfile.native b/modules/tournament/src/main/docker/Dockerfile.native new file mode 100644 index 0000000..2514f94 --- /dev/null +++ b/modules/tournament/src/main/docker/Dockerfile.native @@ -0,0 +1,29 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# +# Before building the container image run: +# +# ./gradlew :modules:tournament:build -Dquarkus.native.enabled=true +# +# Then, build the image with: +# +# docker build -f modules/tournament/src/main/docker/Dockerfile.native -t quarkus/tournament . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/tournament +# +# The `registry.access.redhat.com/ubi9/ubi-minimal:9.7` base image is based on UBI 9. +# To use UBI 8, switch to `quay.io/ubi8/ubi-minimal:8.10`. +### +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7 +WORKDIR /work/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root --chmod=0755 modules/tournament/build/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/modules/tournament/src/main/docker/Dockerfile.native-micro b/modules/tournament/src/main/docker/Dockerfile.native-micro new file mode 100644 index 0000000..cc19d6f --- /dev/null +++ b/modules/tournament/src/main/docker/Dockerfile.native-micro @@ -0,0 +1,32 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# It uses a micro base image, tuned for Quarkus native executables. +# It reduces the size of the resulting container image. +# Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image. +# +# Before building the container image run: +# +# ./gradlew build -Dquarkus.native.enabled=true +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/tournament . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/tournament +# +# The `quay.io/quarkus/ubi9-quarkus-micro-image:2.0` base image is based on UBI 9. +# To use UBI 8, switch to `quay.io/quarkus/quarkus-micro-image:2.0`. +### +FROM quay.io/quarkus/ubi9-quarkus-micro-image:2.0 +WORKDIR /work/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root --chmod=0755 build/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/modules/tournament/versions.env b/modules/tournament/versions.env new file mode 100644 index 0000000..0e288f2 --- /dev/null +++ b/modules/tournament/versions.env @@ -0,0 +1,3 @@ +MAJOR=0 +MINOR=1 +PATCH=0