如何使用 Docker 部署 OpenL 平板电脑?

How to deply OpenL Tablets with Docker?

我想部署OpenL Tablets with Docker. I used the official Docker image for OpenL Tablets WS

部署 OpenL 平板电脑

我按照记录启动了 Docker 容器:

To use file system repo

To run OpenL Tablets Rule Services with filesystem datasource you can mount your local folder to the container:

$ docker run -d --rm -p 9080:8080 -v <path_to_datasource>:/root/.openl/openl-ruleservice/datasource openltablets/ws
  • -e ruleservice.datasource.filesystem.supportDeployments=true - enables support for deployments
    

部署规则

为了测试,我先复制了解压缩的 tutorial into the mounted directory, see Chapter 4: Deploy OpenL Tablets Web Services

c. Put your rule project to the appropriate datasource folder. Every rule project should be represented as a separate folder. As an example you can use OpenL Tablets Tutorial that you can download from the OpenL Tablets web site.

结果

进入后URLhttp://localhost:9080我看到:

我做错了什么?为什么没有显示教程?

我在非Docker安装指南中找到了答案,参见OpenL Tablets BRMS 安装指南

4.2 Configuring OpenL Tablets Rule Services for a Local File System Data Source

Using a file system as a data source for user projects means that projects are stored in a local folder. This folder represents single deployment containing all projects. Each project must also be represented as a separate folder. This is the default data source configured in the system.

To deploy OpenL Tablets Rule Services, configure a local file system as a data source as follows:

  1. Navigate to the <TOMCAT_HOME>\webapps folder and extract the OpenL Tablets Rule Services WAR file. For example, right click the OpenL Tablets Rule Services WAR file name and select 7-zip > Open archive. For more information on downloading OpenL Tablets Rule Services as a WAR file, see Downloading Preconfigured OpenL Tablets Rule Services.

  2. Navigate to the WEB-INF\classes folder, open the application.properties file, and for the ruleservice.datasource.dir setting, define the address to the folder with projects.

    For example:
    ruleservice.datasource.dir = d:/datasource/

    Note that for proper parsing of Java properties file, the path to the folder must be defined with a slash (‘/’) as the folders delimiter. Back slash “\” is not allowed.

  3. Check if the property is defined as production-repository.factory = org.openl.rules.repository.LocalRepositoryFactory.

添加环境变量后

  • production-repository.factory
  • ruleservice.datasource.dir

有效。

docker run  \
  --detach  \
  --publish 9080:8080 \
  --mount type=bind,source=/home/ubuntu/openl/datasource,target=/root/datasource,readonly \
  --env production-repository.factory=org.openl.rules.repository.LocalRepositoryFactory \
  --env ruleservice.datasource.dir=/root/datasource \
  openltablets/ws