Deploy with Docker-compose

The whole Optimization Server can be deployed from docker-compose, this page explains how to do it.


Make sure you have already installed :

You should already know about docker and docker-compose basics.

You must have downloaded the archive that contains the installation files and uncompressed it.

You must have access to the Optimization Server Docker registry. If you want to install the optional CPLEX workers, you must also have access to the CPLEX registry. Below their URL:

  • Optimization Server registry:
  • CPLEX registry

Step 1: Configuration

With the installation files, there is a prefilled .env file that you must adapt to your environment. The default values allows you to install locally, you must update the file if you install on a server. Below the default .env content and explanations for each parameter:

# Image registry for DBOS and infrastructure
# Image registry for CPLEX workers

# DBOS and infrastructure versions

# URL used to access Keycloak. Use a public DNS domain in production  (ex:
# URL used to access DBOS. Use a public DNS domain in production (ex:

# Random private security key. You MUST change it in production.

Step 2: Docker login

Before installing, you must be logg in to the image registry with the following command:

docker login

If you want to install the optional CPLEX workers, you must logg in to the second image registry with:

docker login

Step 3: Startup the application.

You can now start the whole Optimization Server environment with the following command line :

docker-compose up -d

Then to make Optimization Server usefull, you must deploy some workers.

Start CPLEX workers (optional)

To start the pre-packaged Cplex / CpOptimizer / OPL workers, use the following command:

docker-compose -f docker-compose-workers.yml up -d

This starts one container per pre-packaged worker. You can scale up workers, for instance if you want 3 running cplex-cpo-worker, run the following command:

docker-compose -f docker-compose-workers.yml up -d --scale cplex-cpo-worker=3

Embedded keycloak

The Optimization Server Keycloak image is based on the jboss/keycloak image and contains:

  • The DecisionBrain graphical theme for login and account pages.
  • A pre-configured realm, client, group, and users configuration.

You can use this image and configure it the way you want via the admin interface or use any Keycloak system you may already have.

Step 4 : Application parameters.

The OptimizationServer master application is a spring-boot application: you can use the standard spring boot parameters as environment parameters in the docker container. Java workers (pre-packaged or custom ones) are also spring-boot applications, so the same parameters may apply.

Please note that a parameter is formatted in upper case, with ‘_’ characters instead of ‘.’ (For example becomes SPRING_RABBITMQ_HOST in docker).

This is a list of the common useful parameters to use :

Parameter name Description default
SPRING_RABBITMQ_USERNAME Rabbit MQ user name. decisionbrain
SPRING_RABBITMQ_PASSWORD Rabbit MQ password. decisionbrain
SPRING_RABBITMQ_HOST Rabbit MQ host : this should be a valid service name in the docker compose network. localhost
SPRING_RABBITMQ_WSPORT Rabbit MQ stomp port, used for websockets. 61613
SPRING_RABBITMQ_MANAGEMENTPORT Rabbit MQ management console port. 15672
SPRING_DATA_MONGODB_HOST Mongo db host (this should be a valid service name in the docker compose network). localhost
SPRING_DATA_MONGODB_PORT Mongo db port. 27017
SPRING_DATA_MONGODB_DATABASE Mongo db database. optimserver-master-db
JAVA_OPTS JVM options (example: -Xmx500m -Xms10m).
OPTIMSERVER.MONGO.ENTITIES.TTL The mongo entities time to live (in seconds) -1
OPTIMSERVER.STARTJOBEXECUTION.DEFAULTASYNCJOBTTL This value is used when a job is created without any timeout value. A job will be abandoned if no worker can resolve it within this value (in seconds). 3600 * 24 * 7
OPTIMSERVER.JWTKEY The secret key used to sign JTW tokens (32 characters string) ohxeiTiv2vaiGeichoceiChee9siweiL

Step 5 : Containers parameters.

The containers can also be tuned by using the cpu and memory parameters (Full documentation )

For example, the following parameters limit the usage of the CPU and set the maximum available memory

    cpu_percent: 75
    mem_limit: 500M