Fin dockerisation
This commit is contained in:
parent
945c57ddfd
commit
e203d7539c
21 changed files with 335 additions and 190 deletions
|
|
@ -15,6 +15,7 @@ services:
|
||||||
container_name: "businessCentral"
|
container_name: "businessCentral"
|
||||||
volumes:
|
volumes:
|
||||||
- gitdata:/home/niodir
|
- gitdata:/home/niodir
|
||||||
|
- lucenedata:/home/lucene
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network:
|
||||||
ipv4_address: 172.27.0.5
|
ipv4_address: 172.27.0.5
|
||||||
|
|
@ -24,61 +25,9 @@ services:
|
||||||
|
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
|
|
||||||
admin-console:
|
|
||||||
image: runtime-admin-console
|
|
||||||
container_name: "admin-console"
|
|
||||||
volumes:
|
|
||||||
- gitdata:/home/niodir
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipv4_address: 172.27.0.6
|
|
||||||
ports:
|
|
||||||
- 8200:8200
|
|
||||||
links:
|
|
||||||
- businessProxyDB:mongodb
|
|
||||||
- elasticsearchhost
|
|
||||||
- kie-wb
|
|
||||||
depends_on:
|
|
||||||
- businessProxyDB
|
|
||||||
- elasticsearchhost
|
|
||||||
- kie-wb
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
|
|
||||||
elasticsearchhost:
|
|
||||||
image: docker.elastic.co/elasticsearch/elasticsearch:6.6.1
|
|
||||||
container_name: "elasticsearchhost"
|
|
||||||
ulimits:
|
|
||||||
memlock:
|
|
||||||
soft: -1
|
|
||||||
hard: -1
|
|
||||||
volumes:
|
|
||||||
- esdata2:/usr/share/elasticsearch/data
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipv4_address: 172.27.0.7
|
|
||||||
ports:
|
|
||||||
- 9300:9300
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
businessProxyDB:
|
|
||||||
image: mongo
|
|
||||||
container_name: "businessProxyDB"
|
|
||||||
volumes:
|
|
||||||
- mongodb:/data/db
|
|
||||||
- mongodb_config:/data/configdb
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipv4_address: 172.27.0.3
|
|
||||||
ports:
|
|
||||||
- 28017:27017
|
|
||||||
command: mongod
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mongodb:
|
mongodb:
|
||||||
mongodb_config:
|
mongodb_config:
|
||||||
gitdata:
|
gitdata:
|
||||||
|
lucenedata:
|
||||||
esdata2:
|
esdata2:
|
||||||
|
|
@ -15,6 +15,7 @@ services:
|
||||||
container_name: "businessCentral"
|
container_name: "businessCentral"
|
||||||
volumes:
|
volumes:
|
||||||
- gitdata:/home/niodir
|
- gitdata:/home/niodir
|
||||||
|
- lucenedata:/home/lucene
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network:
|
||||||
ipv4_address: 172.27.0.5
|
ipv4_address: 172.27.0.5
|
||||||
|
|
@ -24,18 +25,17 @@ services:
|
||||||
|
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
|
|
||||||
admin-console:
|
admin-console:
|
||||||
image: runtime-admin-console
|
image: runtime-admin-console
|
||||||
container_name: "admin-console"
|
container_name: "admin-console"
|
||||||
volumes:
|
|
||||||
- gitdata:/home/niodir
|
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network:
|
||||||
ipv4_address: 172.27.0.6
|
ipv4_address: 172.27.0.6
|
||||||
ports:
|
ports:
|
||||||
- 8200:8200
|
- 8200:8200
|
||||||
links:
|
links:
|
||||||
- businessProxyDB
|
- businessProxyDB:mongodb
|
||||||
- elasticsearchhost
|
- elasticsearchhost
|
||||||
- kie-wb
|
- kie-wb
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
@ -44,6 +44,123 @@ services:
|
||||||
- kie-wb
|
- kie-wb
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
|
runtime-proxy-1:
|
||||||
|
image: runtime-proxy
|
||||||
|
container_name: "runtime-proxy-1"
|
||||||
|
networks:
|
||||||
|
drools-network:
|
||||||
|
ipv4_address: 172.27.0.22
|
||||||
|
ports:
|
||||||
|
- 8090
|
||||||
|
- 9080
|
||||||
|
links:
|
||||||
|
- businessProxyDB:mongodb
|
||||||
|
- kie-wb:kie-wb
|
||||||
|
depends_on:
|
||||||
|
- businessProxyDB
|
||||||
|
- kie-wb
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
runtime-proxy-2:
|
||||||
|
image: runtime-proxy
|
||||||
|
container_name: "runtime-proxy-2"
|
||||||
|
networks:
|
||||||
|
drools-network:
|
||||||
|
ipv4_address: 172.27.0.32
|
||||||
|
ports:
|
||||||
|
- 8090
|
||||||
|
- 9080
|
||||||
|
links:
|
||||||
|
- businessProxyDB:mongodb
|
||||||
|
- kie-wb:kie-wb
|
||||||
|
depends_on:
|
||||||
|
- businessProxyDB
|
||||||
|
- kie-wb
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
runtime-proxy-3:
|
||||||
|
image: runtime-proxy
|
||||||
|
container_name: "runtime-proxy-3"
|
||||||
|
networks:
|
||||||
|
drools-network:
|
||||||
|
ipv4_address: 172.27.0.42
|
||||||
|
ports:
|
||||||
|
- 8090
|
||||||
|
- 9080
|
||||||
|
links:
|
||||||
|
- businessProxyDB:mongodb
|
||||||
|
- kie-wb:kie-wb
|
||||||
|
depends_on:
|
||||||
|
- businessProxyDB
|
||||||
|
- kie-wb
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
runtime-proxy-4:
|
||||||
|
image: runtime-proxy
|
||||||
|
container_name: "runtime-proxy-4"
|
||||||
|
networks:
|
||||||
|
drools-network:
|
||||||
|
ipv4_address: 172.27.0.52
|
||||||
|
ports:
|
||||||
|
- 8090
|
||||||
|
- 9080
|
||||||
|
links:
|
||||||
|
- businessProxyDB:mongodb
|
||||||
|
- kie-wb:kie-wb
|
||||||
|
depends_on:
|
||||||
|
- businessProxyDB
|
||||||
|
- kie-wb
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
runtime-proxy-5:
|
||||||
|
image: runtime-proxy
|
||||||
|
container_name: "runtime-proxy-5"
|
||||||
|
networks:
|
||||||
|
drools-network:
|
||||||
|
ipv4_address: 172.27.0.62
|
||||||
|
ports:
|
||||||
|
- 8090
|
||||||
|
- 9080
|
||||||
|
links:
|
||||||
|
- businessProxyDB:mongodb
|
||||||
|
- kie-wb:kie-wb
|
||||||
|
depends_on:
|
||||||
|
- businessProxyDB
|
||||||
|
- kie-wb
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
|
||||||
|
runtime-indexer:
|
||||||
|
image: runtime-indexer
|
||||||
|
container_name: "runtime-indexer"
|
||||||
|
networks:
|
||||||
|
drools-network:
|
||||||
|
ipv4_address: 172.27.0.23
|
||||||
|
links:
|
||||||
|
- businessProxyDB:mongodb
|
||||||
|
- elasticsearchhost
|
||||||
|
depends_on:
|
||||||
|
- businessProxyDB
|
||||||
|
- elasticsearchhost
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
runtime-reverse-proxy:
|
||||||
|
image: runtime-reverse-proxy
|
||||||
|
container_name: "runtime-reverse-proxy"
|
||||||
|
networks:
|
||||||
|
drools-network:
|
||||||
|
ipv4_address: 172.27.0.25
|
||||||
|
|
||||||
|
links:
|
||||||
|
- businessProxyDB:mongodb
|
||||||
|
depends_on:
|
||||||
|
- businessProxyDB
|
||||||
|
ports:
|
||||||
|
- 9500:9500
|
||||||
|
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -73,12 +190,14 @@ services:
|
||||||
drools-network:
|
drools-network:
|
||||||
ipv4_address: 172.27.0.3
|
ipv4_address: 172.27.0.3
|
||||||
ports:
|
ports:
|
||||||
- 28017:27017
|
- 28017:27017
|
||||||
command: mongod
|
command: mongod
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mongodb:
|
mongodb:
|
||||||
mongodb_config:
|
mongodb_config:
|
||||||
gitdata:
|
gitdata:
|
||||||
|
lucenedata:
|
||||||
esdata2:
|
esdata2:
|
||||||
|
|
@ -1,75 +0,0 @@
|
||||||
version: "3"
|
|
||||||
|
|
||||||
|
|
||||||
networks:
|
|
||||||
assurfleet-network:
|
|
||||||
ipam:
|
|
||||||
config:
|
|
||||||
- subnet: 172.26.0.0/24
|
|
||||||
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
assurfleet-webapp:
|
|
||||||
image: assurfleet-webapp
|
|
||||||
container_name: "assurfleet-webapp"
|
|
||||||
networks:
|
|
||||||
assurfleet-network:
|
|
||||||
ipv4_address: 172.26.0.5
|
|
||||||
ports:
|
|
||||||
- 8099:8099
|
|
||||||
- 9091:9091
|
|
||||||
- 9095:9095
|
|
||||||
links:
|
|
||||||
- petiteFlotteDB
|
|
||||||
depends_on:
|
|
||||||
- petiteFlotteDB
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
assurfleet-courtier:
|
|
||||||
image: assurfleet-front-courtier-petiteflotte
|
|
||||||
container_name: "assurfleet-courtier"
|
|
||||||
networks:
|
|
||||||
assurfleet-network:
|
|
||||||
ipv4_address: 172.26.0.4
|
|
||||||
ports:
|
|
||||||
- 8200:8200
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
assurfleet-grossiste:
|
|
||||||
image: assurfleet-front-grossiste-petiteflotte
|
|
||||||
container_name: "assurfleet-grossiste"
|
|
||||||
networks:
|
|
||||||
assurfleet-network:
|
|
||||||
ipv4_address: 172.26.0.2
|
|
||||||
ports:
|
|
||||||
- 8101:8101
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
green-card-portail-front:
|
|
||||||
image: green-card-portail-front
|
|
||||||
container_name: "green-card-portail-front"
|
|
||||||
networks:
|
|
||||||
assurfleet-network:
|
|
||||||
ipv4_address: 172.26.0.9
|
|
||||||
ports:
|
|
||||||
- 8600:8600
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
petiteFlotteDB:
|
|
||||||
image: mongo
|
|
||||||
container_name: "petiteFlotteDB"
|
|
||||||
volumes:
|
|
||||||
- mongodb:/data/db
|
|
||||||
- mongodb_config:/data/configdb
|
|
||||||
networks:
|
|
||||||
assurfleet-network:
|
|
||||||
ipv4_address: 172.26.0.3
|
|
||||||
ports:
|
|
||||||
- 8098:27017
|
|
||||||
command: mongod
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
mongodb:
|
|
||||||
mongodb_config:
|
|
||||||
|
|
@ -8,6 +8,6 @@ import java.security.PublicKey;
|
||||||
|
|
||||||
public class MyPublickeyAuthenticator implements PublickeyAuthenticator {
|
public class MyPublickeyAuthenticator implements PublickeyAuthenticator {
|
||||||
public boolean authenticate(String s, PublicKey publicKey, ServerSession serverSession) {
|
public boolean authenticate(String s, PublicKey publicKey, ServerSession serverSession) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,7 @@
|
||||||
<ports>
|
<ports>
|
||||||
<port>10080:8080</port>
|
<port>10080:8080</port>
|
||||||
<port>10001:8001</port>
|
<port>10001:8001</port>
|
||||||
|
<port>50505:50505</port>
|
||||||
</ports>
|
</ports>
|
||||||
</run>
|
</run>
|
||||||
</image>
|
</image>
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,6 @@ chown jboss:jboss $JBOSS_HOME/standalone/configuration/application-roles.propert
|
||||||
# Switchback to jboss user
|
# Switchback to jboss user
|
||||||
USER root
|
USER root
|
||||||
#RUN yum install -y git
|
#RUN yum install -y git
|
||||||
RUN mkdir /home/db
|
|
||||||
RUN mkdir /home/lucene
|
RUN mkdir /home/lucene
|
||||||
RUN mkdir /home/niodir
|
RUN mkdir /home/niodir
|
||||||
RUN mkdir /home/kie-example
|
RUN mkdir /home/kie-example
|
||||||
|
|
@ -75,7 +74,7 @@ RUN mkdir /m2_kiewb/repository
|
||||||
RUN mkdir -p /m2_kiewb/repository/org/guvnor/guvnor-asset-mgmt-project/$KIE_VERSION && \
|
RUN mkdir -p /m2_kiewb/repository/org/guvnor/guvnor-asset-mgmt-project/$KIE_VERSION && \
|
||||||
curl -o /m2_kiewb/repository/org/guvnor/guvnor-asset-mgmt-project/$KIE_VERSION/guvnor-asset-mgmt-project-$KIE_VERSION.jar $KIE_REPOSITORY/org/guvnor/guvnor-asset-mgmt-project/$KIE_VERSION/guvnor-asset-mgmt-project-$KIE_VERSION.jar
|
curl -o /m2_kiewb/repository/org/guvnor/guvnor-asset-mgmt-project/$KIE_VERSION/guvnor-asset-mgmt-project-$KIE_VERSION.jar $KIE_REPOSITORY/org/guvnor/guvnor-asset-mgmt-project/$KIE_VERSION/guvnor-asset-mgmt-project-$KIE_VERSION.jar
|
||||||
|
|
||||||
RUN chown jboss:jboss /home/db
|
|
||||||
RUN chown jboss:jboss /home/lucene
|
RUN chown jboss:jboss /home/lucene
|
||||||
RUN chown jboss:jboss /home/niodir
|
RUN chown jboss:jboss /home/niodir
|
||||||
RUN chown jboss:jboss /home/kie-example
|
RUN chown jboss:jboss /home/kie-example
|
||||||
|
|
@ -88,9 +87,8 @@ RUN chown -R jboss:jboss /m2_kiewb/repository
|
||||||
####### EXPOSE INTERNAL JBPM GIT PORT ############
|
####### EXPOSE INTERNAL JBPM GIT PORT ############
|
||||||
EXPOSE 8001
|
EXPOSE 8001
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
EXPOSE 50505
|
||||||
####### RUNNING DROOLS-WB ############
|
####### RUNNING DROOLS-WB ############
|
||||||
VOLUME /home/db
|
|
||||||
VOLUME /home/lucene
|
VOLUME /home/lucene
|
||||||
VOLUME /home/niodir
|
VOLUME /home/niodir
|
||||||
WORKDIR $JBOSS_HOME/bin/
|
WORKDIR $JBOSS_HOME/bin/
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
# Start Wildfly with the given arguments.
|
# Start Wildfly with the given arguments.
|
||||||
echo "Running Drools Workbench on JBoss Wildfly..."
|
echo "Running Drools Workbench on JBoss Wildfly..."
|
||||||
exec ./standalone.sh -b $JBOSS_BIND_ADDRESS -c $KIE_SERVER_PROFILE.xml -Djava.net.preferIPv4Stack=true -Dorg.uberfire.metadata.index.dir=/home/lucene -Dorg.uberfire.nio.git.daemon.host=0.0.0.0 -Dorg.guvnor.m2repo.dir=/m2_kiewb/repository -DM2_HOME=/m2_kiewb/repository -Dorg.uberfire.nio.git.dir=/home/niodir -Dorg.appformer.m2repo.url=http://localhost:8080/kie-wb/maven2 -Dkie.maven.settings.custom=/m2_kiewb/settings.xml -Dfile.encoding=UTF-8 -Duser.language=fr -Duser.country=FR
|
#export JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,address=50505,suspend=y,server=y"
|
||||||
|
exec ./standalone.sh -b $JBOSS_BIND_ADDRESS -c $KIE_SERVER_PROFILE.xml -Djava.net.preferIPv4Stack=true -Dorg.uberfire.metadata.index.dir=/home/lucene -Dorg.uberfire.nio.git.daemon.host=0.0.0.0 -Dorg.guvnor.m2repo.dir=/m2_kiewb/repository -DM2_HOME=/m2_kiewb/repository -Dorg.uberfire.nio.git.dir=/home/niodir -Dorg.appformer.m2repo.url=http://localhost:8080/kie-wb/maven2 -Dkie.maven.settings.custom=/m2_kiewb/settings.xml -Dfile.encoding=UTF-8 -Duser.language=fr -Duser.country=FR
|
||||||
exit $?
|
exit $?
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,8 +147,8 @@
|
||||||
<orderEntry type="library" name="Maven: com.google.guava:guava:13.0.1" level="project" />
|
<orderEntry type="library" name="Maven: com.google.guava:guava:13.0.1" level="project" />
|
||||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
|
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.7" level="project" />
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.7" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.kie:kie-internal:7.17.0.Final" level="project" />
|
<orderEntry type="library" name="Maven: org.kie:kie-internal:7.18.0.Final" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.kie:kie-api:7.17.0.Final" level="project" />
|
<orderEntry type="library" name="Maven: org.kie:kie-api:7.18.0.Final" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.kie.soup:kie-soup-maven-support:7.17.0.Final" level="project" />
|
<orderEntry type="library" name="Maven: org.kie.soup:kie-soup-maven-support:7.18.0.Final" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
|
|
@ -3,7 +3,8 @@ FROM openjdk:8-jre-slim
|
||||||
|
|
||||||
ADD application.properties /application.properties
|
ADD application.properties /application.properties
|
||||||
ADD maven/drools-framework-business-indexer-app-1.0-SNAPSHOT.jar app.jar
|
ADD maven/drools-framework-business-indexer-app-1.0-SNAPSHOT.jar app.jar
|
||||||
|
RUN mkdir /root/.ssh
|
||||||
|
RUN echo toto > /root/.ssh/known_hosts
|
||||||
|
|
||||||
|
|
||||||
RUN bash -c 'touch /app.jar'
|
RUN bash -c 'touch /app.jar'
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,6 @@ import org.springframework.stereotype.Component;
|
||||||
public class DeclareNewSftpRouter extends RouteBuilder {
|
public class DeclareNewSftpRouter extends RouteBuilder {
|
||||||
@Override
|
@Override
|
||||||
public void configure() throws Exception {
|
public void configure() throws Exception {
|
||||||
from("quartz2://myGroup/myTimerName?cron=0+0/1+*+?+*+MON-FRI").to("bean:startRouteService?method=updateConfig()");
|
from("quartz2://myGroup/myTimerName?cron=0/5+*+*+?+*+*").to("bean:startRouteService?method=updateConfig()");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,8 @@
|
||||||
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.google.guava:guava:13.0.1" level="project" />
|
<orderEntry type="library" name="Maven: com.google.guava:guava:13.0.1" level="project" />
|
||||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.1" level="project" />
|
<orderEntry type="library" name="Maven: commons-io:commons-io:2.1" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.kie:kie-internal:7.17.0.Final" level="project" />
|
<orderEntry type="library" name="Maven: org.kie:kie-internal:7.18.0.Final" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.kie:kie-api:7.17.0.Final" level="project" />
|
<orderEntry type="library" name="Maven: org.kie:kie-api:7.18.0.Final" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.kie.soup:kie-soup-maven-support:7.17.0.Final" level="project" />
|
<orderEntry type="library" name="Maven: org.kie.soup:kie-soup-maven-support:7.18.0.Final" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
|
|
@ -266,8 +266,8 @@
|
||||||
|
|
||||||
<run>
|
<run>
|
||||||
<extraHosts>
|
<extraHosts>
|
||||||
<host>mongodb:172.17.0.1</host>
|
<host>mongodb:192.168.2.17</host>
|
||||||
<host>kie-wb:172.17.0.1</host>
|
<host>kie-wb:192.168.2.17</host>
|
||||||
</extraHosts>
|
</extraHosts>
|
||||||
<ports>
|
<ports>
|
||||||
<port>8200:8200</port>
|
<port>8200:8200</port>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,17 @@
|
||||||
FROM openjdk:8-jre-slim
|
FROM openjdk:8-jre-slim
|
||||||
|
|
||||||
EXPOSE 8200
|
|
||||||
EXPOSE 9080
|
EXPOSE 9080
|
||||||
|
EXPOSE 8090
|
||||||
ADD application.properties /application.properties
|
ADD application.properties /application.properties
|
||||||
ADD maven/drools-framework-business-proxy-app-1.0-SNAPSHOT.jar app.jar
|
ADD maven/drools-framework-business-proxy-app-1.0-SNAPSHOT.jar app.jar
|
||||||
|
USER root
|
||||||
RUN mkdir /m2_kieserver
|
RUN mkdir /m2_kieserver
|
||||||
RUN mkdir /m2_kieserver/repository
|
RUN mkdir /m2_kieserver/repository
|
||||||
ADD settings.xml /m2_kieserver/settings.xml
|
ADD settings.xml /m2_kieserver/settings.xml
|
||||||
RUN mkdir /trace
|
RUN mkdir /trace
|
||||||
RUN mkdir /niodir-kieserver
|
RUN mkdir /niodir-kieserver
|
||||||
|
|
||||||
|
|
||||||
RUN bash -c 'touch /app.jar'
|
RUN bash -c 'touch /app.jar'
|
||||||
|
ENV JAVA_OPTS "-Dspring.config.location=file:./ -DM2_HOME=/m2_kieserver -Dorg.chtijbug.server.tracedir=/trace -Dorg.appformer.m2repo.url=http://kie-wb:8080/kie-wb/maven2 -Dorg.uberfire.nio.git.dir=/niodir-kieserver -Dkie.maven.settings.custom=/m2_kieserver/settings.xml -Dorg.kie.server.repo=/niodir-kieserver -Dfile.encoding=UTF-8 -Duser.language=fr -Duser.country=FR -Dorg.chtijbug.server.sftpPort=9080"
|
||||||
|
|
||||||
ENTRYPOINT ["java","-Dspring.config.location=file:/ -DM2_HOME=/m2_kieserver -Dorg.chtijbug.server.tracedir=/trace -Dorg.appformer.m2repo.url=http://kie-wb:8080/kie-wb/maven2 -Dorg.uberfire.nio.git.dir=/niodir-kieserver -Dkie.maven.settings.custom=/m2_kieserver/settings.xml -Dorg.kie.server.repo=/niodir-kieserver -Dfile.encoding=UTF-8 -Duser.language=fr -Duser.country=FR -Dorg.kie.server.id=server1 -Dorg.chtijbug.server.sftpPort=9080","-jar","/app.jar"]
|
ENTRYPOINT exec java $JAVA_OPTS -jar /app.jar
|
||||||
#ENTRYPOINT ["java","-jar","/app.jar"]
|
|
||||||
|
|
@ -20,4 +20,4 @@ camel.springboot.name=MyCamel
|
||||||
# to reconfigure the camel servlet context-path mapping to use /api/* instead of /camel/*
|
# to reconfigure the camel servlet context-path mapping to use /api/* instead of /camel/*
|
||||||
camel.component.servlet.mapping.context-path=/api/*
|
camel.component.servlet.mapping.context-path=/api/*
|
||||||
spring.data.mongodb.database=businessProxyDB
|
spring.data.mongodb.database=businessProxyDB
|
||||||
spring.data.mongodb.host=mongodb:27017
|
spring.data.mongodb.host=mongodb:27017
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,9 @@ package org.chtijbug.drools.proxy;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
|
||||||
// CHECKSTYLE:OFF
|
// CHECKSTYLE:OFF
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class DroolsBusinessProxyServer {
|
public class DroolsBusinessProxyServer {
|
||||||
|
|
@ -28,6 +31,16 @@ public class DroolsBusinessProxyServer {
|
||||||
* Main method to start the application.
|
* Main method to start the application.
|
||||||
*/
|
*/
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
if (System.getProperty("org.kie.server.id") == null) {
|
||||||
|
InetAddress inetAddress = null;
|
||||||
|
try {
|
||||||
|
inetAddress = InetAddress.getLocalHost();
|
||||||
|
String hostName = inetAddress.getHostName();
|
||||||
|
System.setProperty("org.kie.server.id", hostName);
|
||||||
|
} catch (UnknownHostException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
SpringApplication.run(DroolsBusinessProxyServer.class, args);
|
SpringApplication.run(DroolsBusinessProxyServer.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,11 +88,12 @@ public class KieServiceCommon {
|
||||||
}
|
}
|
||||||
this.marshallerHelper = new MarshallerHelper(this.server.getServerRegistry());
|
this.marshallerHelper = new MarshallerHelper(this.server.getServerRegistry());
|
||||||
|
|
||||||
|
public static String getKieServerID(){
|
||||||
|
return System.getProperty("org.kie.server.id");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
private void initCamelBusinessRoutes() {
|
private void initCamelBusinessRoutes() {
|
||||||
String serverName = System.getProperty("org.kie.server.id");
|
String serverName = KieServiceCommon.getKieServerID();
|
||||||
String sftpPort = System.getProperty("org.chtijbug.server.sftpPort");
|
String sftpPort = System.getProperty("org.chtijbug.server.sftpPort");
|
||||||
List<RuntimePersist> itIsMes = runtimeRepository.findByServerName(serverName);
|
List<RuntimePersist> itIsMes = runtimeRepository.findByServerName(serverName);
|
||||||
if (itIsMes.size() == 0) {
|
if (itIsMes.size() == 0) {
|
||||||
|
|
@ -125,7 +126,7 @@ public class KieServiceCommon {
|
||||||
}
|
}
|
||||||
@PreDestroy
|
@PreDestroy
|
||||||
public void stopRuntime(){
|
public void stopRuntime(){
|
||||||
String serverName = System.getProperty("org.kie.server.id");
|
String serverName =KieServiceCommon.getKieServerID();
|
||||||
List<RuntimePersist> itIsMes = runtimeRepository.findByServerName(serverName);
|
List<RuntimePersist> itIsMes = runtimeRepository.findByServerName(serverName);
|
||||||
if (itIsMes.size()==1){
|
if (itIsMes.size()==1){
|
||||||
RuntimePersist runtimePersist =itIsMes.get(0);
|
RuntimePersist runtimePersist =itIsMes.get(0);
|
||||||
|
|
@ -179,6 +180,13 @@ public class KieServiceCommon {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DroolsChtijbugRulesExecutionService getDroolsChtijbugRulesExecutionService() {
|
||||||
|
return droolsChtijbugRulesExecutionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public KieServerRegistry getRegistry() {
|
||||||
|
return registry;
|
||||||
|
}
|
||||||
|
|
||||||
public KieServerImpl getServer() {
|
public KieServerImpl getServer() {
|
||||||
return server;
|
return server;
|
||||||
|
|
@ -207,7 +215,7 @@ public class KieServiceCommon {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateConfig() throws Exception {
|
public void updateConfig() throws Exception {
|
||||||
String serverName = System.getProperty("org.kie.server.id");
|
String serverName = KieServiceCommon.getKieServerID();
|
||||||
List<ContainerPojoPersist> containers = containerRepository.findByServerNameAndStatus(serverName, ContainerPojoPersist.STATUS.TODEPLOY.toString());
|
List<ContainerPojoPersist> containers = containerRepository.findByServerNameAndStatus(serverName, ContainerPojoPersist.STATUS.TODEPLOY.toString());
|
||||||
for (ContainerPojoPersist element : containers) {
|
for (ContainerPojoPersist element : containers) {
|
||||||
this.disposeContainer(element.getContainerId());
|
this.disposeContainer(element.getContainerId());
|
||||||
|
|
@ -246,7 +254,7 @@ public class KieServiceCommon {
|
||||||
logger.info("GenericResource.runSession", e);
|
logger.info("GenericResource.runSession", e);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
String serverName = System.getProperty("org.kie.server.id");
|
String serverName = KieServiceCommon.getKieServerID();
|
||||||
ContainerPojoPersist containerPojoPersist = containerRepository.findByServerNameAndContainerId(serverName, id);
|
ContainerPojoPersist containerPojoPersist = containerRepository.findByServerNameAndContainerId(serverName, id);
|
||||||
if (containerPojoPersist == null) {
|
if (containerPojoPersist == null) {
|
||||||
containerPojoPersist = new ContainerPojoPersist();
|
containerPojoPersist = new ContainerPojoPersist();
|
||||||
|
|
@ -322,7 +330,7 @@ public class KieServiceCommon {
|
||||||
|
|
||||||
public ServiceResponse<Void> disposeContainer(String id) {
|
public ServiceResponse<Void> disposeContainer(String id) {
|
||||||
ServiceResponse<Void> result = server.disposeContainer(id);
|
ServiceResponse<Void> result = server.disposeContainer(id);
|
||||||
String serverName = System.getProperty("org.kie.server.id");
|
String serverName =KieServiceCommon.getKieServerID();
|
||||||
ContainerPojoPersist element = containerRepository.findByServerNameAndContainerId(serverName, id);
|
ContainerPojoPersist element = containerRepository.findByServerNameAndContainerId(serverName, id);
|
||||||
if (element != null) {
|
if (element != null) {
|
||||||
containerRepository.delete(element);
|
containerRepository.delete(element);
|
||||||
|
|
|
||||||
|
|
@ -6,63 +6,41 @@ import org.chtijbug.drools.kieserver.extension.KieServerAddOnElement;
|
||||||
import org.chtijbug.drools.kieserver.extension.KieServerLoggingDefinition;
|
import org.chtijbug.drools.kieserver.extension.KieServerLoggingDefinition;
|
||||||
import org.chtijbug.drools.logging.SessionExecution;
|
import org.chtijbug.drools.logging.SessionExecution;
|
||||||
import org.chtijbug.kieserver.services.drools.ChtijbugObjectRequest;
|
import org.chtijbug.kieserver.services.drools.ChtijbugObjectRequest;
|
||||||
import org.chtijbug.kieserver.services.drools.DroolsChtijbugKieServerExtension;
|
|
||||||
import org.chtijbug.kieserver.services.drools.DroolsChtijbugRulesExecutionService;
|
|
||||||
import org.kie.server.services.api.KieContainerInstance;
|
import org.kie.server.services.api.KieContainerInstance;
|
||||||
import org.kie.server.services.api.KieServerExtension;
|
|
||||||
import org.kie.server.services.api.KieServerRegistry;
|
|
||||||
import org.kie.server.services.impl.KieServerImpl;
|
|
||||||
import org.kie.server.services.impl.KieServerLocator;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.temporal.ChronoField;
|
import java.time.temporal.ChronoField;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@Service("ruleService")
|
@Service("ruleService")
|
||||||
public class RuleService {
|
public class RuleService {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(RuleService.class);
|
private static final Logger logger = LoggerFactory.getLogger(RuleService.class);
|
||||||
private DroolsChtijbugRulesExecutionService droolsChtijbugRulesExecutionService = null;
|
|
||||||
private DroolsChtijbugKieServerExtension droolsChtijbugKieServerExtension;
|
|
||||||
private KieServerRegistry registry;
|
|
||||||
private ObjectMapper mapper = new ObjectMapper();
|
private ObjectMapper mapper = new ObjectMapper();
|
||||||
private KieServerImpl server;
|
@Inject
|
||||||
|
private KieServiceCommon kieServiceCommon;
|
||||||
|
|
||||||
public RuleService() {
|
public RuleService() {
|
||||||
this.server = KieServerLocator.getInstance();
|
System.out.println("rulestep01");
|
||||||
List<KieServerExtension> serverExtensions = this.server.getServerExtensions();
|
|
||||||
for (KieServerExtension serverExtension : serverExtensions) {
|
|
||||||
if (serverExtension instanceof DroolsChtijbugKieServerExtension) {
|
|
||||||
droolsChtijbugKieServerExtension = (DroolsChtijbugKieServerExtension) serverExtension;
|
|
||||||
if (droolsChtijbugRulesExecutionService == null) {
|
|
||||||
|
|
||||||
droolsChtijbugRulesExecutionService = droolsChtijbugKieServerExtension.getRulesExecutionService();
|
|
||||||
}
|
|
||||||
if (registry == null) {
|
|
||||||
registry = droolsChtijbugRulesExecutionService.getContext();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object runSessionObject(String transactionID, String id, String processID, Object input) throws IOException {
|
public Object runSessionObject(String transactionID, String id, String processID, Object input) throws IOException {
|
||||||
KieContainerInstance kci = registry.getContainer(id);
|
KieContainerInstance kci = kieServiceCommon.getRegistry().getContainer(id);
|
||||||
ChtijbugObjectRequest chtijbugObjectRequest = new ChtijbugObjectRequest();
|
ChtijbugObjectRequest chtijbugObjectRequest = new ChtijbugObjectRequest();
|
||||||
chtijbugObjectRequest.setObjectRequest(input);
|
chtijbugObjectRequest.setObjectRequest(input);
|
||||||
KieServerAddOnElement kieServerAddOnElement = droolsChtijbugRulesExecutionService.getKieServerAddOnElement();
|
KieServerAddOnElement kieServerAddOnElement = kieServiceCommon.getDroolsChtijbugRulesExecutionService().getKieServerAddOnElement();
|
||||||
if (kieServerAddOnElement != null) {
|
if (kieServerAddOnElement != null) {
|
||||||
for (KieServerLoggingDefinition kieServerLoggingDefinition : kieServerAddOnElement.getKieServerLoggingDefinitions()) {
|
for (KieServerLoggingDefinition kieServerLoggingDefinition : kieServerAddOnElement.getKieServerLoggingDefinitions()) {
|
||||||
kieServerLoggingDefinition.OnFireAllrulesStart(kci.getKieContainer().getReleaseId().getGroupId(), kci.getKieContainer().getReleaseId().getArtifactId(), kci.getKieContainer().getReleaseId().getVersion(), input);
|
kieServerLoggingDefinition.OnFireAllrulesStart(kci.getKieContainer().getReleaseId().getGroupId(), kci.getKieContainer().getReleaseId().getArtifactId(), kci.getKieContainer().getReleaseId().getVersion(), input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ChtijbugObjectRequest chtijbutObjectResponse = droolsChtijbugRulesExecutionService.FireAllRulesAndStartProcess(kci, chtijbugObjectRequest, processID);
|
ChtijbugObjectRequest chtijbutObjectResponse = kieServiceCommon.getDroolsChtijbugRulesExecutionService().FireAllRulesAndStartProcess(kci, chtijbugObjectRequest, processID);
|
||||||
/**
|
/**
|
||||||
* remove facts from logging to avoid infinite loop when marshalling to json and size of logging
|
* remove facts from logging to avoid infinite loop when marshalling to json and size of logging
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -90,4 +90,141 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>${spring.boot-version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>docker-build</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>io.fabric8</groupId>
|
||||||
|
<artifactId>docker-maven-plugin</artifactId>
|
||||||
|
<version>0.21.0</version>
|
||||||
|
|
||||||
|
<configuration>
|
||||||
|
<!--registry>192.168.1.184:12500</registry-->
|
||||||
|
<dockerHost>${docker.Host}</dockerHost>
|
||||||
|
|
||||||
|
<!-- this is for Mac and Amazon Linux -->
|
||||||
|
<!--dockerHost>unix:///var/run/docker.sock</dockerHost-->
|
||||||
|
|
||||||
|
<verbose>true</verbose>
|
||||||
|
<images>
|
||||||
|
<image>
|
||||||
|
<name>runtime-reverse-proxy</name>
|
||||||
|
<build>
|
||||||
|
<dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
|
||||||
|
|
||||||
|
<!--copies Jar to the maven directory (uses Assembly system)-->
|
||||||
|
<assembly>
|
||||||
|
<descriptorRef>artifact</descriptorRef>
|
||||||
|
</assembly>
|
||||||
|
<tags>
|
||||||
|
<tag>latest</tag>
|
||||||
|
</tags>
|
||||||
|
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<run>
|
||||||
|
<extraHosts>
|
||||||
|
<host>mongodb:192.168.43.94</host>
|
||||||
|
</extraHosts>
|
||||||
|
|
||||||
|
</run>
|
||||||
|
</image>
|
||||||
|
</images>
|
||||||
|
</configuration>
|
||||||
|
|
||||||
|
<executions>
|
||||||
|
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>build</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
|
||||||
|
|
||||||
|
</executions>
|
||||||
|
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>docker-deploy</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>io.fabric8</groupId>
|
||||||
|
<artifactId>docker-maven-plugin</artifactId>
|
||||||
|
<version>0.21.0</version>
|
||||||
|
|
||||||
|
<configuration>
|
||||||
|
<!--registry>192.168.1.184:12500</registry-->
|
||||||
|
<dockerHost>${docker.Host}</dockerHost>
|
||||||
|
|
||||||
|
<!-- this is for Mac and Amazon Linux -->
|
||||||
|
<!--dockerHost>unix:///var/run/docker.sock</dockerHost-->
|
||||||
|
|
||||||
|
<verbose>true</verbose>
|
||||||
|
<images>
|
||||||
|
<image>
|
||||||
|
<name>runtime-reverse-proxy</name>
|
||||||
|
<build>
|
||||||
|
<dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
|
||||||
|
|
||||||
|
<!--copies Jar to the maven directory (uses Assembly system)-->
|
||||||
|
<assembly>
|
||||||
|
<descriptorRef>artifact</descriptorRef>
|
||||||
|
</assembly>
|
||||||
|
<tags>
|
||||||
|
<tag>latest</tag>
|
||||||
|
</tags>
|
||||||
|
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<run>
|
||||||
|
<extraHosts>
|
||||||
|
<host>mongodb:192.168.1.100</host>
|
||||||
|
</extraHosts>
|
||||||
|
|
||||||
|
</run>
|
||||||
|
</image>
|
||||||
|
</images>
|
||||||
|
</configuration>
|
||||||
|
|
||||||
|
<executions>
|
||||||
|
|
||||||
|
|
||||||
|
<execution>
|
||||||
|
<id>mydeploy</id>
|
||||||
|
<phase>deploy</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>push</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
|
||||||
|
</executions>
|
||||||
|
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
FROM openjdk:8-jre-slim
|
||||||
|
|
||||||
|
|
||||||
|
ADD application.properties /application.properties
|
||||||
|
ADD maven/drools-framework-business-reverse-proxy-1.0-SNAPSHOT.jar app.jar
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
RUN bash -c 'touch /app.jar'
|
||||||
|
|
||||||
|
ENTRYPOINT ["java","-Dspring.config.location=file:./","-jar","/app.jar"]
|
||||||
|
#ENTRYPOINT ["java","-jar","/app.jar"]
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
server.port=9500
|
||||||
|
|
||||||
|
spring.data.mongodb.database=businessProxyDB
|
||||||
|
spring.data.mongodb.host=mongodb:27017
|
||||||
2
pom.xml
2
pom.xml
|
|
@ -19,7 +19,7 @@
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<jbpm.version>7.17.0.Final</jbpm.version>
|
<jbpm.version>7.18.0.Final</jbpm.version>
|
||||||
<spring.boot.version>1.5.12.RELEASE</spring.boot.version>
|
<spring.boot.version>1.5.12.RELEASE</spring.boot.version>
|
||||||
<spring.version>4.3.16.RELEASE</spring.version>
|
<spring.version>4.3.16.RELEASE</spring.version>
|
||||||
<version.thorntail>2.2.1.Final</version.thorntail>
|
<version.thorntail>2.2.1.Final</version.thorntail>
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue