arkha před 1 rokem
rodič
revize
2c0d3cb720

+ 2 - 0
MWUI/.dockerignore

@@ -0,0 +1,2 @@
+.DS_Store
+pom.xml

+ 6 - 10
MWUI/Dockerfile

@@ -7,7 +7,7 @@ LABEL \
     org.opencontainers.image.authors="Arkhadius" \
     org.opencontainers.image.vendor="Hanoman" \
     org.opencontainers.image.url="local" \
-    org.opencontainers.image.source="https://code.senomas.com/arkha/btnmw-was" \
+    org.opencontainers.image.source="https://code.senomas.com/arkha/btnmw-was/MWUI" \
     org.opencontainers.image.version="$VERSION" \
     org.opencontainers.image.revision="$REVISION" \
     vendor="Hanoman" \
@@ -16,14 +16,10 @@ LABEL \
     summary="The MWUI microservice from the Containerizing microservices MWUI" \
     description="This image contains the MWUI microservice running with the Open Liberty runtime."
 
-COPY --chown=1001:0 \
-    target/liberty/wlp/usr/servers/defaultServer/server.xml \
-    /config/
+USER root
 
+COPY --chown=1001:0 src/main/liberty/config/server.xml /config/
 RUN features.sh
-
-COPY --chown=1001:0 \
-    target/MWUI-1.0.war \
-    /config/apps
-
-RUN configure.sh
+COPY --chown=1001:0 target/*.war /config/apps
+RUN configure.sh
+USER 1001

+ 16 - 0
MWUI/pom.xml

@@ -152,6 +152,18 @@
       <artifactId>db2jcc4</artifactId>
       <version>4.0</version>
     </dependency>
+
+    <dependency>
+      <groupId>org.codehaus.groovy</groupId>
+      <artifactId>groovy-all</artifactId>
+      <version>2.5.11</version>
+      <type>pom</type>
+    </dependency>
+    <dependency>
+      <groupId>org.jdom</groupId>
+      <artifactId>jdom</artifactId>
+      <version>1.1</version>
+    </dependency>
   </dependencies>
 
   <build>
@@ -174,6 +186,10 @@
         <groupId>io.openliberty.tools</groupId>
         <artifactId>liberty-maven-plugin</artifactId>
         <version>3.11.1</version>
+        <configuration>
+          <appsDirectory>apps</appsDirectory>
+          <installAppPackages>project</installAppPackages>
+        </configuration>
       </plugin>
     </plugins>
   </build>

+ 6 - 2
MWUI/src/config/server.xml → MWUI/src/main/liberty/config/server.xml

@@ -8,6 +8,8 @@
         <feature>jdbc-4.2</feature>
     </featureManager>
 
+    <variable name="http.port" defaultValue="9080" />
+    <variable name="https.port" defaultValue="9443" />
     <variable name="serverdb.name" defaultValue="localhost" />
     <variable name="serverdb.port" defaultValue="5000" />
     <variable name="db.user" defaultValue="db2inst1" />
@@ -77,6 +79,7 @@
         <properties.db2.jcc
             serverName="${serverdb.name}"
             portNumber="${serverdb.port}"
+            currentSchema="MWCONFIG"
             databaseName="MWCONFIG"
             user="${db.user}"
             password="${db.pwd}" />
@@ -85,11 +88,12 @@
     <!-- To access this server from a remote client add a host attribute to the following element,
     e.g. host="*" -->
     <httpEndpoint id="defaultHttpEndpoint"
-        httpPort="9080"
-        httpsPort="9443" />
+        httpPort="${http.port}"
+        httpsPort="${https.port}" />
 
     <!-- Automatically expand WAR files and EAR files -->
     <applicationManager autoExpand="true" />
+    <webApplication id="mwui" location="MWUI-1.0.war" contextRoot="/MWUI" />
 
     <!-- Default SSL configuration enables trust for default certificates from the Java runtime -->
     <!-- <ssl id="defaultSSLConfig" trustDefaultCerts="true" /> -->

+ 8 - 7
MWUI/src/main/webapp/WEB-INF/classes/hibernate-mwconfig.cfg.xml

@@ -9,8 +9,8 @@
 		<property name="hibernate.connection.datasource">jdbc/db2/mwconfig_mwui_ds</property-->
 
 		<!-- udah dikomen -->
-		<property
-			name="hibernate.connection.datasource">jdbc/db2/mwconfig_mwui_ds</property>
+		<!-- <property
+			name="hibernate.connection.datasource">jdbc/db2/mwconfig_mwui_ds</property> -->
 
 		<!--property
 		name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
@@ -26,12 +26,13 @@
 		<!-- <property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property> -->
 		<!--property
 		name="hibernate.connection.url">jdbc:db2://172.15.30.28:25010/MWCONFIG:currentSchema=MWCONFIG;</property-->
-		<!-- <property
-		name="hibernate.connection.url">jdbc:db2://10.10.10.36:50000/MWCONFIG:currentSchema=MWCONFIG;</property> -->
+		<property
+			name="hibernate.connection.url">
+			jdbc:db2://10.10.10.36:50000/MWCONFIG:currentSchema=MWCONFIG;</property>
 
-		<!-- <property name="hibernate.connection.username">db2inst1</property> -->
-		<!-- <property name="hibernate.connection.password">mdw4dm1n</property> -->
-		<!-- <property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property> -->
+		<property name="hibernate.connection.username">db2inst1</property>
+		<property name="hibernate.connection.password">mdw4dm1n</property>
+		<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
 
 		<property name="hibernate.show_sql">false</property>
 		<property name="hibernate.format_sql">true</property>