From 058bb4ef1cbeeeb9cc99d98050e6b2f9eefc3913 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 23 Jan 2022 14:55:07 -0800 Subject: [PATCH] Fix initialization scripts for docker --- distribution/Dockerfile | 5 ++++- distribution/README.md | 18 ++++++++++++------ distribution/build-image.sh | 3 ++- wise-ui/pom.xml | 8 ++++---- .../webapp/WEB-INF/wisemapping-datasource.xml | 9 +++++++-- 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/distribution/Dockerfile b/distribution/Dockerfile index d2639ba4..8cab69fc 100644 --- a/distribution/Dockerfile +++ b/distribution/Dockerfile @@ -5,8 +5,11 @@ FROM tomcat:9.0-jdk17-openjdk LABEL maintainer="Paulo Gustavo Veiga " -#Build variables ... +# Build variables ... ARG WEBAPP_TARGET_DIR="/usr/local/tomcat/webapps/ROOT" + +# Defautl ENV configurations ... +ENV JAVA_OPTS="-XX:+PrintFlagsFinal -XX:InitialRAMPercentage=30 -XX:MaxRAMPercentage=80" ENV database.base.url="/var/wisemapping" # Copy wisemapping distribution ... diff --git a/distribution/README.md b/distribution/README.md index 8b469073..2acf7131 100644 --- a/distribution/README.md +++ b/distribution/README.md @@ -9,33 +9,39 @@ There are multiple ways to run WiseMapping depending on your database configurat ## Option 1: Running HSQL within the image storage -> docker run -it --rm -p 8888:8080 wisemapping +> docker run -it --rm -p 8080:8080 veigap/wisemapping:latest> Then, open your browser at `http://localhost:8888`. A default user is available for testing `test@wisemapping.com` and password `test`. -***This option, all changes will be lost once the image is stopped. Use it for testing only *** +***This option, all changes will be lost once the image is stopped. Use it for testing only*** ## Option 2: Running HSQL with mounted directory -> docker run -it --rm -p 8888:8080 wisemapping +> docker run -it --rm -p 8080:8080 veigap/wisemapping:latest ## Option 3: External MySQL/PostgreSQL ### Setup database +Depending on the database your want to configure, you can create initialization scripts [here](https://bitbucket.org/wisemapping/wisemapping-open-source/src/develop/config/database/) + ### Configure application properties The next step is configure the WiseMapping for the database and credentials. Download `app.properties` configuration file and configure the required sections: -`curl https://bitbucket.org/wisemapping/wisemapping-open-source/raw/644b7078d790220c7844b732a83d45495f11d64e/wise-webapp/src/main/webapp/WEB-INF/app.properties` +> $ curl https://bitbucket.org/wisemapping/wisemapping-open-source/raw/644b7078d790220c7844b732a83d45495f11d64e/wise-webapp/src/main/webapp/WEB-INF/app.properties' ### Starting the application Run the application mounting your previously configured `app.properties` -> docker run --mount type=bind,source=/app.properties,target=/usr/local/tomcat/webapps/ROOT/classes/app.properties -it --rm -p 8888:8080 wisemapping +> $ docker run --mount type=bind,source=your-file-path/app.properties,target=/usr/local/tomcat/webapps/ROOT/WEB-INF/app.properties -it --rm -p 8080:8080 veigap/wisemapping:latest # Advanced configuration -> docker run --mount type=bind,source=/Users/veigap/repos/wisemapping-open-source/distribution/app.properties,target=/usr/local/tomcat/webapps/ROOT/classes/app.properties -it --rm -p 8888:8080 wisemapping \ No newline at end of file +## Increase Tomcat memory +> docker run\ +> --mount type=bind,source -m 1.5GB -e JAVA_OPTS=" -XX:+PrintFlagsFinal -XX:InitialRAMPercentage=30 -XX:MaxRAMPercentage=80" +> -it --rm -p 8888:8080 veigap/wisemapping:latest \ No newline at end of file diff --git a/distribution/build-image.sh b/distribution/build-image.sh index 855c1f7d..a6ded6a4 100755 --- a/distribution/build-image.sh +++ b/distribution/build-image.sh @@ -3,4 +3,5 @@ set -o set -u -docker build -t wisemapping -f ./Dockerfile ../wise-webapp/target/ \ No newline at end of file +mvn -f ../pom.xml clean package +docker build -t veigap/wisemapping:latest -f ./Dockerfile ../wise-webapp/target/ \ No newline at end of file diff --git a/wise-ui/pom.xml b/wise-ui/pom.xml index 4e522bc7..3f008fd3 100644 --- a/wise-ui/pom.xml +++ b/wise-ui/pom.xml @@ -29,11 +29,11 @@ - + - + @@ -42,11 +42,11 @@ - + - + diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-datasource.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-datasource.xml index 417f7052..1a33feff 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-datasource.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-datasource.xml @@ -9,8 +9,13 @@ - - + + + + + + +