Set Environment-Specific Configuration with Docker
On this page
Introduction
Goal
Configure a Bloomreach Experience Manager Docker image for a specific environment.
Background
To facilitate running on different platforms with various configurations, the Bloomreach Experience Manager Docker image contains several configuration variables such as repository variables, several JVM variables, and Tomcat variables.
Default Environment-Specific Configuration with Docker
Default system and environment variables are set both in dockerFile in the docker image and in the setenv.sh bash file that is used to set environment variables in a Tomcat instance.
The following variables are set in dockerFile by default:
Other system and environment variables are set in setenv.sh bash file in Tomcat’s bin folder as follows:
Adding -Djava.security.egd=file:/dev/./urandom in the setenv.sh file will prevent it.
Check the Tomcat wiki for more information.
Setting Environment-Specific Configuration with Docker
If you use the docker.run Maven profile to run the Docker image, you can set the following environment variables to docker.run profile configuration:
Or you can pass them on the command-line using as system properties:
You can also set the environment variables by passing parameters to the docker run command:
Setting Jackrabbit Cluster Node Id with Docker
When the Bloomreach Experience Manager application runs in a clustered environment, the Jackrabbit cluster node ID should be set properly. Each node must have a unique cluster node id in the cluster. In the default docker configuration, the Jackrabbit cluster node ID is set with the hostname of the container. If you need to change the default value, you can define a new value by setting the REPO_CLUSTER_NODE_ID environment variable.
Define REPO_CLUSTER_NODE_ID in the docker.run profile configuration:
or pass it on the command-line using as system property:
Provide a Stored Lucene Index
When starting a new container to connect to an existing Bloomreach Experience Manager cluster, a new local lucene index must be generated during the startup process. This can be very time-consuming for a large or long-lived repository. To accelerate this part of the startup process, a container can be seeded with an existing lucene index that was exported from an existing cluster node. See the Lucene Index Export docs for more information.
As of Bloomreach Experience Manager version 14.3.0, the default Dockerfile provided by the project archetype supports using an existing lucene index at container startup. To use this, a zip file produced by the Lucene Index Export plugin must be available on the new container's file system, typically by mapping it to a container volume. Set the location of the index zip file in the environment variable LUCENE_INDEX_FILE_PATH.
Required Environment Variables to Run the Image With a Database In Non-Development Environment
Several environment variables are supposed to be set to run the Bloomreach Experience Manager docker image with a MySQL or a Postgres database instance. The environment variable named profile defines which database type the Bloomreach Experience Manager container will connect to. The profile variable can have one of the following values: h2, mysql, postgres.
As an example, to run the Bloomreach Experience Manager image with a mysql database, a sample docker compose file is as follows:
The other environment variables that are required to run the image with a database are set in Dockerfile. The default values of these environment variables are as follows.