You can use GraalVM Community JDK to generate a JAR for this app. We have a shell script that uses multistage Docker build to build a JAR file using Maven and ship the app JAR in a separate runtime docker image.
./scripts/build-jar-ce.sh
Run this command to see the docker image:
docker images -a
The output is similar to:
REPOSITORY TAG IMAGE ID CREATED SIZE
jibber-jar-gvmce22-jdk17 0.0.1 4c23c1f3fb2d 24 seconds ago 656MB
A Docker Compose file has ben provided that will start the container. Most sections have been commented out. Feel free to uncomment sections, as needed.
Go to docker-compose.yml, comment the jibber-ni-gvmee-jdk17:
section. Uncomment the jibber-jar-gvmce-jdk17:
section and run the following command to run the app JAR.
docker compose up --remove-orphans
This will start the app JAR on port 8081. Go to http://localhost:8081/jibber in a browser and you should see a nonsense verse.
From another terminal window, run the following command:
docker compose stop