Compose

This section covers the configuration to use Compose a tool for defining and running multi-container applications with Docker. It's divided into the following subsections:

Create docker-compose.yml

Create file

Create a new file called docker-compose.yml under the /opt/onegini/etc folder. An add the following content to docker-compose.yml

tokenserver:
  image: releases.onegini.com/token-server-<OVERLAY>:<VERSION>
  environment:
    - ONEGINI_OPTS=-Xms512m -Xmx512m

    - CONFIG_BACKEND=etcd://172.17.42.1:2379
    - CONFIG_PREFIX=/onegini

    - TOKENSERVER_ADMIN_ENABLED=true
    - TOKENSERVER_CLIENT_ENABLED=true
    - TOKENSERVER_ENGINE_ENABLED=true
  restart: always
  user: onegini
  volumes:
    - "/var/lib/onegini/token-server/keystore:/opt/data/keystore"
    - "/var/lib/onegini/token-server/truststore:/opt/data/truststore"
  ports:
    - "80:8080"
    - "443:8443"

Of course you need to configure the properties according to the environment

Configuration parameters

Propertie Default Description
ONEGINI_OPTS -Xms512m -Xmx512m JAVA JVM Properties
CONFIG_BACKEND etcd://172.17.42.1:4001 Backend type ip and port of the config backend
CONFIG_PREFIX Key path prefix of config backend.
TOKENSERVER_​ADMIN_​ENABLED true Option to enable admin role.
TOKENSERVER_​CLIENT_​ENABLED true Option to enable client role.
TOKENSERVER_​ENGINE_​ENABLED true Option to enable engine role.

Starting container

Now start the container(s).

docker-compose -f /etc/onegini/docker-compose.yml up -d

This command will stop, remove and start a new container on the same time. For more information see the Docker Compose documentation.