Semantic Enhancement Server (SES) using Docker
- Last Updated: May 13, 2026
- 4 minute read
- Semaphore
- Documentation
To build a docker image and containers for the Semantic Enhancement Server:
-
Create a folder for your Smantic Enhancement Server docker project. Store all the files in this folder.
-
Download all the necessary RPM intstallation files to install SES. You will need:
-
A valid licence file: A valid licence file: Copy the licence file to project folder and name
licence. -
Java 11 x64: A supported JDK. In this example, we will be using Amazon Corretto JDK 11 RPM for Linux x64.
-
Semantic Enhancement Server (SES) RPM installation file
See Semaphore component installation files for a list of RPM installation files.
-
-
Create a file named
start-ses.shcontaining the following:#!/bin/bash function shutdown { echo echo \"Stopping Semaphore Semantic Enhancement Server\" /opt/semaphore/SES/bin/SESservice.sh stop -force echo exit } echo echo "Starting Semaphore Semantic Enhancement Server on port 8983" /opt/semaphore/SES/bin/SESservice.sh start -c -force echo trap shutdown SIGHUP SIGINT SIGTERM while true do sleep 1 doneYou will use this script to launch containers. This script launches the Semantic Enhancement Server as a background process and then sleeps periodically until the container stops. The
trapcommand maps certain process signals to our custom shutdown function, which exits the script. -
Optionally, increase the Java heap for Semantic Enhancement Server to suit your environment. To do this:
a. Create a patch file using diff for the file
/opt/semaphore/SES/solr/bin/solr.in.sh. The patch file will contain content that takes the following form:--- solr.in.sh 2020-11-16 14:44:44.000000000 -0800 +++ solr.in.sh.mod 2020-11-19 13:19:43.000000000 -0800 @@ -28,7 +28,7 @@ #SOLR_STOP_WAIT="180" # Increase Java Heap as needed to support your indexing / query needs -#SOLR_HEAP="512m" +SOLR_HEAP="1g" # Expert: If you want finer control over memory options, specify them directly # Comment out SOLR_HEAP if you are using this though, that takes precedenceb. Use the patch command to apply this change to SES configuration when building the image:
RUN yum install -y --setopt=tsflags=nodocs patch COPY solr.in.sh.patch /opt/semaphore/SES/solr/bin/solr.in.sh.patch RUN patch --directory /opt/semaphore/SES/solr/bin --ignore-whitespace < /opt/semaphore/SES/solr/bin/solr.in.sh.patch -
Create a modified version of
web.xmlfor SES. Modifications include additions to the file that enable CORS headers so that web applications can access SES services without being hosted on the same container. In this procedure, we use a whole file, but a patch would also work. The contents of the file take the following form:<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun. <filter> <filter-name>cross-origin</filter-name> <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class> <init-param> <param-name>allowedOrigins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>allowedMethods</param-name> <param-value>GET,POST,DELETE,PUT,HEAD,OPTIONS</param-value> </init-param> <init-param> <param-name>allowedHeaders</param-name> <param-value>origin, content-type, cache-control, accept, options,authorization, x-requested-with</param-value> </init-param> <init-param> <param-name>supportsCredentials</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>chainPreflight</param-name> <param-value>false</param-value> </init-param> </filter> <filter-mapping> <filter-name>cross-origin</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>SESConversionFilter</filter-name> <filter-class>com.smartlogic.ses.solrfilter.SESConversionFilter</filter-class> <init-param> <param-name>defaultLanguage</param-name> <param-value>en</param-value> </init-param> </filter> <filter-mapping> <filter-name>SESConversionFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app> -
Modify the service wrapper script called
SESservice.shfor SES to make it work properly in a container. Note that you can download a copy of this file from the Semaphore GitHub repository. The file takes the following form:#!/bin/sh SCRIPT=$(readlink -f "$0") SCRIPTPATH=$(dirname "$SCRIPT") source $SCRIPTPATH/CheckJava.sh cd $SCRIPTPATH/.. $SHELL $SCRIPTPATH/../solr/bin/solr $@ -
Once all the prerequisite files are copied to your project folder, build the Dockerfile. The Dockerfile performs the following tasks:
-
Starts by using the Oracle Enterprise Linux version 8 image
-
Installs all the RPMs
-
Configure some environment variables,
-
Copies files and scripts onto the local image
-
Defines the exposed ports and
/var/opt/semaphoreas our external volume. The external volume at/var/opt/semaphoreis very important so that you can mount a named external volume. This prevents you from losing logs,solrindex core directories, and any customizations each time.
The following is an example DockerFile:
FROM oraclelinux:8 LABEL maintainer="Progress Semaphore Semaphore Ltd" LABEL sem5-version="5.6.3" # Copy local RPMs and licence file to image RUN mkdir /local-rpms/ COPY *.rpm /local-rpms/ # Get package updates and install rpms, and clean up. RUN yum -y --setopt=tsflags=nodocs update && \ yum install -y --setopt=tsflags=nodocs patch && \ yum install -y --setopt=tsflags=nodocs /local-rpms/java-11-amazon-corretto-devel-11.0.*.*.rpm && \ yum install -y /local-rpms/Semaphore-SES-5.6.3-1.noarch.rpm && \ yum clean all # Copy licence file from local dir to image. COPY ./licence /opt/semaphore/licence # copy the patch into place to increase Java heap and patch solr.in.sh COPY solr.in.sh.patch /opt/semaphore/SES/solr/bin/solr.in.sh.patch RUN patch --directory /opt/semaphore/SES/solr/bin --ignore-whitespace < /opt/semaphore/SES/solr/bin/solr.in.sh patch \ # Set the licence directory environment variable. ENV SEMAPHORE_LICENCE_DIR /opt/semaphore #Copy in the daemon creation script and start script COPY start-ses.sh /opt/semaphore COPY SESservice.sh /opt/semaphore/SES/bin/SESservice.sh # make scripts executable RUN chmod 777 /opt/semaphore/start-ses.sh RUN chmod 777 /opt/semaphore/SES/bin/SESservice.sh # web.xml with CORS headers enabled COPY web.xml /opt/semaphore/SES/solr/server/ses-webapp/webapp/WEB-INF/web.xml # set path environment variable ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/semaphore # external volume off union filesystem VOLUME ["/var/opt/semaphore"] WORKDIR /opt/semaphore EXPOSE 8983 9983 CMD ["/opt/semaphore/start-ses.sh"] -
-
Build the image using the following command:
docker build -t ses563 . -
Once the image is successfully built, run to build a container instance using the following command:
docker run -d \--name ses563-1 -p 8983:8983 -p 9983:9983 \ --mount src=sem5_ses_volume,target=/var/opt/semaphore,type=volume \ ses563Note the use of the
--mountflag. It is very important to use a named volume for the external volume indicated at/var/opt/semaphore. -
Use the docker
pscommand to verify that the container is running. If successful, you should see the following container running:CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 542787b5bda1 ses563 "/opt/semaphore/star..." About a minute ago Up 3 seconds 0.0.0.0:8983->8983/tcp, 0.0.0.0:9983->9983/tcp ses563-1
Open your browser and navigate to http://localhost:8983/ses to confirm that SES is up and running.