Skip to content

On-Premises

The Adaptricity Platform is run as a Docker container. We recommend Ubuntu 22.04 LTS as the operating system and Docker Engine version 24. The Docker image is available in our private Docker registry at registry.adaptricity.com. You'll be provided with the credentials by your technical contact.

Adaptricity needs access to a MongoDB database as a storage backend, an example how to run a MongoDB database on the same machine as the application is included in this documentation. The MongoDB database needs to be run as a replica set.

To serve the application, any web server can be used. In this documentation, traefik is being used. SSL certificates are provided by letsencrypt. For the automatic SSL certificate generation to work, the machine needs to be reachable by the public internet.

Familiarity with Docker and Docker Compose is a prerequisite for a successful installation. Operating systems and Docker versions other than the recommended ones might work but are not tested and we cannot provide support for them.

Security

Beyond the application login, you are responsible to keep your installation of the Adaptricity Platform secure. That includes but is not limited to firewall, updating and patching the operating system, encrypting the data at rest and backups.

Installation

Below you'll see a list of files and an example for each of these files. Values to replace by custom values are denoted in < … >. For example, in app/.env you need to replace <adaptricity.my-company.com> by the name of the host under which the Adaptricity Platform will be reachable at.

File and Folder Structure

traefik/
  certs/
  docker-compose.yml
app/
  .env
  database/
  docker-compose.yml
  license/
    license.dat
    pubring.gpg
  logs/
  mongo-setup.yml

Traefik Configuration

traefik/docker-compose.yml

yml
version: '3.8'

services:
  proxy:
    image: traefik:v2.10
    container_name: traefik
    command:
      - "--providers.docker.exposedByDefault=false"
      - "--providers.docker.network=traefik"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
      - "--entrypoints.web.http.redirections.entryPoint.scheme=https"
      - "--entrypoints.web.http.redirections.entryPoint.permanent=true"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesResolvers.letsencrypt.acme.email=<adaptricity-system-admin@my-company.com>"
      - "--certificatesResolvers.letsencrypt.acme.storage=/certs/acme.json"
      - "--certificatesResolvers.letsencrypt.acme.tlsChallenge"
    ports:
      - "80:80"
      - "443:443"
    networks:
      - traefik
    volumes:
      - ./certs:/certs
      - /var/run/docker.sock:/var/run/docker.sock
    restart: unless-stopped

networks:
  traefik:
    name: traefik

Application Configuration

app/.env

ini
#########################
# General Configuration #
#########################

# Address (domain with optional subdomain) under which the Adaptricity Platform will be reachable at
HOST=<adaptricity.my-company.com>

# E-Mail of the person responsible for running the Adaptricity Platform
CONTACT_PERSON=<adaptricity-system-admin@my-company.com>

# Name of the Adaptricity Platform instance, only relevant if there are multiple instances
INSTANCE_ID=<adaptricity>

# Heap Size of Java (around 60% of memory available to the app container, at least 2 GB)
HEAP_SIZE=2048M

#########################
# SMTP                  #
#########################

# SMTP configuration for Adaptricity to send emails
SMTP_HOST=<smtp.my-company.com>
SMTP_USER=<adaptricity-smtp-user>
SMTP_PASSWORD=<adaptricity-smtp-password>
SMTP_FROM=<adaptricity@my-company.com>
SMTP_PORT=<465>

app/docker-compose.yml

yml
version: '3.8'

services:
  mongodb:
    container_name: ${COMPOSE_PROJECT_NAME}-mongodb
    image: mongo:5.0.14
    volumes:
      - ./database:/data/db
      - ./logs/mongodb:/var/log/mongodb
    networks:
      - mongo
    restart: unless-stopped
    entrypoint: [
      "/usr/bin/mongod",
      "--bind_ip_all",
      "--replSet", "rs0",
      "--storageEngine", "wiredTiger",
      "--logpath", "/var/log/mongodb/mongolog.log",
      "--logRotate", "reopen",
      "--logappend",
      "--setParameter", "tcmallocAggressiveMemoryDecommit=1",
      "--wiredTigerCollectionBlockCompressor", "zstd",
      "--slowms=10000",
    ]

  mongo_setup:
    container_name: ${COMPOSE_PROJECT_NAME}-mongodb-setup
    image: mongo:5.0.14
    depends_on:
      - mongodb
    volumes:
      - ./mongo-setup.sh:/mongo-setup.sh
    restart: "no"
    environment:
      - COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME}
    networks:
      - mongo
    entrypoint: ["sh", "/mongo-setup.sh"]

  dpgsim:
    container_name: ${COMPOSE_PROJECT_NAME}-dpgsim
    image: registry.adaptricity.com/adaptricity:release
    depends_on:
      - mongodb
    networks:
      - traefik
      - mongo
    expose:
      - 9000
    volumes:
      - ./logs:/dpgapp/logs
      - ./license:/dpgapp/license:ro
    environment:
      # app
      - DPG_SIM_INTERNAL_CONTACT_PERSONS=${CONTACT_PERSON}
      - DPG_SIM_INSTANCE_ID=${INSTANCE_ID}
      - DPG_SIM_SECURESOCIAL_HOSTNAME=${HOST}
      - DPG_SIM_DIRECTORY_PATH_WORK=/dpgwork
      - HEAP_SIZE=${HEAP_SIZE}
      # database
      - MONGODB_URI=${COMPOSE_PROJECT_NAME}-mongodb
      # smtp
      - SMTP_HOST=${SMTP_HOST}
      - SMTP_USER=${SMTP_USER}
      - SMTP_PASSWORD=${SMTP_PASSWORD}
      - SMTP_FROM=${SMTP_FROM}
      - SMTP_PORT=${SMTP_PORT}
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-https.rule=Host(`${HOST}`)"
      - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-https.entrypoints=websecure"
      - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-https.tls=true"
      - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-https.tls.certresolver=letsencrypt"
    restart: unless-stopped

networks:
  mongo:
  traefik:
    external: true

app/mongo-setup.sh

bash
#!/usr/bin/env bash

echo "Initializing mongo replicaset for docker compose project: $COMPOSE_PROJECT_NAME"

sleep 5

ok=$(mongo --quiet --host $COMPOSE_PROJECT_NAME-mongodb:27017 --eval "rs.status().ok")

if [ "$ok" = "0" ]; then

  mongo \
    --quiet \
    --host $COMPOSE_PROJECT_NAME-mongodb:27017 \
    --eval 'rs.initiate({_id: "rs0", version: 1, members: [{_id: 0, host: "'$COMPOSE_PROJECT_NAME'-mongodb:27017"}] })'

else

  member_name=$(mongo --quiet --host $COMPOSE_PROJECT_NAME-mongodb:27017 --eval "rs.status().members[0].name")

  if [ "$member_name" = "localhost:27017" ]; then

    mongo \
      --quiet \
      --host $COMPOSE_PROJECT_NAME-mongodb:27017 \
      --eval 'rs.reconfig({_id: "rs0", version: 1, members: [{_id: 0, host: "'$COMPOSE_PROJECT_NAME'-mongodb:27017"}] })'

  fi
fi

License

The license is provided by your technical contact as a zip archive and contains two files: license.dat and pubring.gpg. Both need to be mounted read-only to the container under the /dpgapp/license path. The license has an end date, after which Adaptricity automatically stops running. To renew your license, contact your sales representative.

Run

When all files above are created and properly customized, you're ready to run the Adaptricity Platform.

bash
# Start Traefik
cd ~/traefik
docker compose up -d

# Login to Registry
docker login registry.adaptricity.com
# enter username and password when prompted

# Start Adaptricity Platform
cd ~/app
docker compose up -d

# Check if containers are running and logs
docker ps
CONTAINER ID   IMAGE                                          COMMAND                  CREATED          STATUS          PORTS                                                                      NAMES
b3263a278317   registry.adaptricity.com/adaptricity:release   "/bin/sh -c '/dpgapp…"   2 minutes ago    Up 1 minutes    9000/tcp                                                                   app-dpgsim
534469c285e2   mongo:5.0.14                                   "/usr/bin/mongod --b…"   2 minutes ago    Up 2 minutes    27017/tcp                                                                  app-mongodb
6c2111d19cc1   traefik:v2.10                                  "/entrypoint.sh --pr…"   3 minutes ago    Up 3 minutes    0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   traefik

# See logs of the Adaptricity Platform container. If everything is well, the Adaptricity logo should appear.
docker logs -f app-dpgsim

[INFO] Loading native library from /dpgapp/./temp/2309842549118_5526037/libadtnative.so...
[INFO] Native library loaded.
[INFO] ApplicationLog (System): Software started.; software version:2a501d281917d03fb64bf2d8faa41cc49d4aca7f

       :~~~.       .::::::::::.          .~~~:        :::::::::::.   .::::::::::::::~. ::.     ::::.      ::~!!!~:.    .:::. .:::::::::::::::.~:::        ::::.
      :GBBB5.      :GBGBBBBBBGG5?:       JBBBB!       YBBBBBBBBBBG5? ~BBBBBBGBBBBBBB?.JBGPY~   7BBG:   :?5GBBBBBBBG5~  :BBB7 ~BBBBBBGBBBBBBB5 ?BBG!      7GBG!
     :PBBGBBY      :GBBJ:~~~!?PBBG~     ?BBGBBG~      YBBP::::::7GBBJ.~~~~~YBBG!~~~: .~~5BBG:  7BBG:  !GBBP7~:::~?57.  :BBB7 .~~~~~YBBG!~~~~:  ~PBBJ.  .YBB5:
    .5BBJ:PBBJ     :GBB7      .PBB5    7BBG:?BBG:     YBBP       PBBP      ?BBG:        7BBB:  7BBG: .GBB5.            :BBB7       JBBG.        :YBBP::PBBJ.
    YBBY  :GBB?    :GBB?       YBBG.  ~BBG~  YBBP:    YBBGJJJJJJ5BBB7      ?BBG: .?JJJJYGBBY.  7BBG: :BBB7             :BBB7       JBBG:          ?BBGGBG!
   JBBG~:::JBBB!   :GBB7       PBBP  :GBBJ:::~GBB5.   YBBGPPPPPP5Y?:       ?BBP.:JPPPBBBGJ~    7BBG: :GBBY             :BBB7       JBBG:           ~GBBP:
  7BBBGGBBBGBBBB~  :GBB?:::::!5BBB! :PBBBGBBBGGBBBY   YBBP                 ?#Y.!5.   :PBBY.    7BBG:  ?BBBY~:...:!Y7.  :BBB7       JBBG:            PBBY
 !BBG!^^^^^^^JBBG: :BBBBBBBBBBGPJ: .PBBY^^^^^^^!GBBJ  YBBP                 ??.JBP     .5BBP:   ?BBB:   ~5GBBBGGGBBBP!  :BBB7       JBBG:           .PBB5
 ~!!:        .!!!~ .!!!!!!!!~::.   :!!!.        :!!!. :!!~                 . :7!~      .!!!~   :!!!.     ::!7777!~:    .!!!:       :!!!.            ~!!~

Congrats!

You've successfully set up Adaptricity. Open your browser and navigate to the address configured as HOST in your app/.env file. You'll see the log-in screen and can use the default credentials (username ad@min.com, password password) to sign in the first time. The Adaptricity Platform will guide you through the setup of your first account.

Custom SSL certificates

To use a custom SSL certificate instead of letsencrypt, add them as adaptricity.cert and adaptricity.key files in the certs directory. Then adapt the traefik's docker-compose.yml as follows and add the traefik/config.yml.

traefik/docker-compose.yml

diff
services:
  proxy:
    command:
+     - "--providers.file.filename=/etc/traefik/config.yml"
-     - "--certificatesResolvers.letsencrypt.acme.email=<adaptricity-system-admin@my-company.com>"
-     - "--certificatesResolvers.letsencrypt.acme.storage=/certs/acme.json"
-     - "--certificatesResolvers.letsencrypt.acme.tlsChallenge"
    volumes:
+     - ./config.yml:/etc/traefik/config.yml

traefik/config.yml

yml
tls:
  certificates:
    - certFile: /certs/adaptricity.crt
      keyFile: /certs/adaptricity.key

app/docker-compose.yml

diff
services:
  dpgsim:
    labels:
-     - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-https.tls.certresolver=letsencrypt"