As I have limited compute and storage resources, I use docker when possible.
The included original Dockerfile creates an image that builds the java executable when running the image (starting the app container) and includes the full JDK environment. The following Dockerfile generates a image that is half the size, includes only a runtime version of java (jre), uses a slim Debian base image and doesn't create the java executable when the container is started. Hence, it uses less resources and is speedier.
Feel free to use the attached Dockerfile and adjust it as needed (rename it to Dockerfile and use docker compose build).
Dockerfile.txt
As I have limited compute and storage resources, I use docker when possible.
The included original Dockerfile creates an image that builds the java executable when running the image (starting the app container) and includes the full JDK environment. The following Dockerfile generates a image that is half the size, includes only a runtime version of java (jre), uses a slim Debian base image and doesn't create the java executable when the container is started. Hence, it uses less resources and is speedier.
Feel free to use the attached Dockerfile and adjust it as needed (rename it to Dockerfile and use docker compose build).
Dockerfile.txt