Sign inSign up

wavemakerapp/app-runtime-tomcat

By wavemakerapp

•Updated 2 months ago

Image
0

9.1K

wavemakerapp/app-runtime-tomcat repository overview

⁠WaveMaker App-Runtime-Tomcat Docker Image

The WaveMaker app-runtime-tomcat Docker image is a lightweight, production-optimized container specifically designed for deploying WaveMaker application WAR files. Based on the Tomcat server, it provides a standardized, reliable environment for easy deployment.

⁠Deploying a WAR File with the App-Runtime-Tomcat Docker Image

To deploy a WAR file created by the app-builder image, mount it into the Tomcat webapps directory within the container using the following command:

docker run -d --name <container-name> -v <your_project_location>/dist/:/usr/local/tomcat/webapps/ -p <host_port>:8080 wavemakerapp/app-runtime-tomcat:<wavemaker_version>

Example:

docker run -d --name wm-app -v /home/user/MySampleApp/dist/:/usr/local/tomcat/webapps/ -p 80:8080 wavemakerapp/app-runtime-tomcat

Note: The app-runtime-tomcat image is designed to work with a WAR file from the app-builder⁠ image. This two-step workflow — first building the WAR file with app-builder, then deploying it with app-runtime-tomcat — enhances modularity and ensures a streamlined, reliable deployment process.

Alternatively, if you already have a WAR file from another source, you can deploy it directly by mounting it to the webapps directory as shown above.

⁠Setting Memory Limits

By default, Java picks a heap size automatically based on the available memory. You can override this and other JVM sizing options with environment variables:

VariableWhat it doesDefault
MIN_HEAP_SIZE_MBMemory Java reserves at startup (MB)JVM default
MAX_HEAP_SIZE_MBMemory Java is allowed to grow to (MB)JVM default
MIN_META_SIZE_MBInitial Metaspace size (MB)JVM default
MAX_META_SIZE_MBMaximum Metaspace size (MB)JVM default
THREAD_STACK_SIZE_KBThread stack size (KB)JVM default
NATIVE_MEMORY_TRACKINGNative memory tracking level: summary, detail, or offsummary
EXTRA_JAVA_OPTSAny other JVM flag, e.g. -XX:+UseG1GCNone
docker run -d --name wm-app \
  -v /home/user/MySampleApp/dist/:/usr/local/tomcat/webapps/ \
  -p 80:8080 \
  -e MIN_HEAP_SIZE_MB=512 \
  -e MAX_HEAP_SIZE_MB=2048 \
  wavemakerapp/app-runtime-tomcat:<wavemaker_version>

⁠If the App Runs Out of Memory

If the app ever runs out of memory, the container automatically:

  1. Saves a heap dump to /usr/local/tomcat/logs/heap-dumps/ — a snapshot you can open in a tool like Eclipse Memory Analyzer (MAT) to see what was using all the memory.
  2. Stops the app, instead of leaving it running in a broken, unresponsive state.

Because the app stops, you need to tell Docker to restart it automatically with --restart on-failure. And to actually retrieve the heap dump afterwards, mount the logs folder to your host with -v:

docker run -d --name wm-app \
  --restart on-failure \
  -v /home/user/MySampleApp/dist/:/usr/local/tomcat/webapps/ \
  -v /home/user/logs:/usr/local/tomcat/logs \
  -p 80:8080 \
  wavemakerapp/app-runtime-tomcat:<wavemaker_version>
VariableWhat it doesDefault
HEAP_DUMP_KEEPNumber of past heap dumps to keep on disk5

If the app keeps running out of memory, the cause is almost always in the application code — something like a cache or list that keeps growing and is never cleared. Open the heap dump in Eclipse MAT and check the "Leak Suspects" report; it usually points straight at the cause.

⁠GC Logs (optional)

Garbage collection logs are written to /usr/local/tomcat/logs/gc.log by default.

VariableWhat it doesDefault
GC_LOGGING_ENABLEDTurn GC logging on/offtrue
GC_LOG_FILECOUNTNumber of rotated log files to keep5
GC_LOG_FILESIZE_MBMax size (MB) of each log file before rotation10
-e GC_LOGGING_ENABLED=false

Tag summary

Content type

Image

Digest

sha256:f87526d60…

Size

215.4 MB

Last updated

2 months ago

docker pull wavemakerapp/app-runtime-tomcat