You can use GraalVM Enterprise 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-ee.sh
If you are prompted to docker login
to OCR, enter your OCR user and password.
Run this command to see the docker image:
docker images -a
The output is similar to:
REPOSITORY TAG IMAGE ID CREATED SIZE
jibber-jar-gvmee22-jdk17 0.0.1 4cc0f93ca0eb 41 seconds ago 669MB
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-gvmee-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 8080. Go to http://localhost:8080/jibber in a browser and you should see a nonsense verse.
From another terminal window, run the following command:
docker compose stop