Docker is a popular platform for building, sharing and running applications. Since the Docker container packages applications with all their libraries and dependencies, the application can run on any Docker host in any supported environment. Among the benefits of this strategy are:
  • Docker containers are faster to create and quicker to start.
  • Docker scales efficiently when demand for your application grows.
  • Corticon Server deployed to Docker as a web application can be accessed as a REST or a SOAP service.
Note: Prepare to deploy Corticon Server to Docker by getting and running Docker for your platform at https://docs.docker.com/get-docker/. Remember to check that Docker is running every time you intend to use your repository.

Download the Corticon Docker package

Each release of Corticon provides a Docker bundle with the Dockerfile configuration file and the .war files for Corticon Server and Corticon Web Console. Download the package, and then unzip it on your target machine, typically at root level. For example, C:\PROGRESS_CORTICON_X.x_DOCKER

For download information, see Download the latest Corticon installer packages.

Edit the Dockerfile with the Corticon configuration

The Dockerfile in the package is preconfigured to deploy Corticon Server to a base Tomcat 9.0 image. You can adjust and add to the configuration to suit your installation.

Open Dockerfile in your preferred text editor.
#Copyright 2005-2020 Progress Software Corporation and/or its subsidiaries and affiliates. All rights reserved.
					
# Specify the tomcat image version to pull from DockerHub 
FROM tomcat:9-jre8
					
USER root
					
# Open port 8080
EXPOSE 8080

# Copy Corticon war files to work directory
COPY axis.war /usr/local/tomcat/webapps
COPY corticon.war /usr/local/tomcat/webapps
					
# Create Deploy and cdd folders
RUN mkdir /usr/local/Deploy
RUN mkdir /usr/local/tomcat/cdd

# To deploy Decision services, copy the eds file and cdd file to the CDD directory
#ADD ProcessOrder.eds /usr/local/tomcat/cdd/
#ADD OrderProcessing.cdd /usr/local/tomcat/cdd/
					
# To enable Corticon Server to use the brms.properties, copy this file to the Corticon Work dir
ADD brms.properties /usr/local/tomcat/
The predefined settings are as follows:
  • FROM statement to specify the base image to be used for this container. The docker file bundled uses a public tomcat-9jre8 image from Dockerhub. You can choose any other supported image from docker hub or build your own. For example, to use tomcat9.0.53 with JRE 11, change the From statement to:
    FROM tomcat:9.0.53-jre11
  • USER is set to root to ensure that the container has full control of the host system.
  • EXPOSE lets you specify the network port on which Docker will listen at runtime.
  • COPY The next steps copy axis.war and corticon.war to the web-apps directory, in this example, tomcat.
  • RUN mkdir sets up the required directories.
  • #ADD Order installs the Decision Service file and the corresponding CDD. Remove the # tag to enable the actions.

Setting Corticon Home and Work Directory

You can set the Corticon Home and Corticon Work directory in the Docker file to point to a preferred location:
  1. Add the lines:
    RUN mkdir /usr/local/tomcat/CORTICONWORK
    ENV CATALINA_OPTS="$CATALINA_OPTS -DCORTICON_HOME=/usr/local/tomcat/CORTICONWORK/"
    ENV CATALINA_OPTS="$CATALINA_OPTS -DCORTICON_WORK_DIR=/usr/local/tomcat/CORTICONWORK/"
  2. Adjust the ADD to ensure that preferences for the Corticon server set in a brms.properties file are copied to the Corticon Work Directory.

Update the Corticon license

You need to copy the license to the container and then update the environment variable.

To add or update the license:

  1. Locate your valid Corticon license for the Server version.
  2. Add the lines:
    RUN mkdir /usr/local/tomcat/LicenseCorticon
    COPY CcLicense.jar /usr/local/tomcat/LicenseCorticon
    ENV CATALINA_OPTS="$CATALINA_OPTS -DCORTICON_LICENSE=/usr/local/tomcat/LicenseCorticon/CcLicense.jar"
    After the configuration is complete, you need to provide the files you specified, and then build the docker image.

Provide specified files

After the preceding steps, you need to copy the specified files into the Docker folder, PROGRESS_CORTICON_X.x_DOCKER:

  • CcLicense.jar from C:\Progress\Corticon X.x\Server\lib
  • brms.properties from C:\Users\user\Progress\CorticonWork_X.x
  • ProcessOrder.eds and OrderProcessing.cdd from C:\Users\user\Progress\CorticonWork_X.x\Samples\Rule Projects\OrderProcessing

Build the Docker container image from the Dockerfile

  1. Open a Command Prompt window as administrator to the root of the Docker installation.
  2. If you are replacing an existing image, type:
    docker container prune	
    and then type y to complete the deletion.
  3. Then, for the new image where corticondemo is your preferred name, type:
    docker ps -a
    docker build -t corticondemo .

For more Docker documentation and options supported with the Docker build command, reference the docker documentation at https://docs.docker.com/.

Run the Docker container

  1. Open a Command Prompt window as administrator to the root of the Docker installation.
  2. Type:
    docker run -p 8080:8080 corticondemo	
Note: Docker has many options for run. See https://docs.docker.com/engine/reference/commandline/run/.

The Tomcat console output shows the server startup log lines.

Confirm the Server operation

Check the Corticon server by accessing the Corticon ping REST end point on the browser:

http://localhost:8080/axis/corticon/server/ping

When the server is running, the REST/GET request returns JSON with the uptime as:

{"uptime" : <time in milliseconds>}

To check that the license has been updated properly, you can check the server properties using the REST end point

http://localhost:8080/axis/corticon/server/getProperties

The REST response returns JSON with the Server properties. When the license has been updated, the licenseFilePath attribute in the JSON has the updated path:

"licenseFilePath":"/usr/local/tomcat/LicenseCorticon/CcLicense.jar",

In the Web Console, connect to the running server in this example as:

The Server Details view shows the license and the properties.

Other platforms

The steps needed to successfully deploy docker to a Tomcat server image can be transformed to other supported application servers listed in the Corticon Supported Platforms Matrix . To deploy Corticon to the different application servers, refer to the Corticon Knowledge Base entry Corticon Server X.x sample WAR installation for different Application Servers for settings on specific application servers.

The configurations specific to deploying a web-app to a different image can differ based on the requirements of the image. However, the Corticon-specific configurations like setting the CORTICON_HOME and CORTICON_WORK_DIR or updating the license stay the same. You still must pass the environment variables like -DCORTICON_LICENSE to update the license or -DCORTICON_HOME to use a different location for Corticon home.

The Dockerfile can be customized to fit your business needs on any supported OS/application server Docker image.