Example - Quickstart using the embedded H2 database

This example shows how to quickly get started with Airlock IAM based on a Docker image and an integrated H2 database. An embedded H2 database is useful for integration work and enables seamless use of the IAM demo configuration.

We recommend using the embedded H2 database only for demo and testing purposes. For production database use, please refer to User data source configuration (databases and directories).

Setting up Airlock IAM with an embedded H2 database can be achieved via Docker CLI or via the docker-compose.yml file. The required commands for both options follow in the code blocks below.

There is no difference in the commands for IAM images obtained from quay.io or for IAM images obtained from Docker Hub, except for the path to the image repositories. To facilitate copy-and-paste, however, the sample code is given for both cases.

Embedding the H2 database with images from quay.io

Via the Docker CLI:

copy
docker run --rm \
  --env "TZ=Europe/Zurich" \
  --env "IAM_LOG_LEVEL=DEBUG" \
  --env "IAM_MODULES=adminapp,loginapp,transaction-approval,api-policy-service,service-container,h2" \
  -v "$(pwd)/iam:/home/airlock/iam" \
  -p 8443:8443 \
  quay.io/airlock/iam:8.1

In the docker-compose.yml:

copy
version: '3.7'
services:
  iam:
    image: quay.io/airlock/iam:8.1 environment:
      - "TZ=Europe/Zurich"
      - "IAM_LOG_LEVEL=DEBUG"
      - "IAM_MODULES=adminapp,loginapp,transaction-approval,api-policy-service,service-container,h2"
    volumes:
      - type: bind
        source: "./iam"
        target: "/home/airlock/iam"
    ports:
      - "8443:8443"

Embedding the H2 database with images from Docker Hub

Via the Docker CLI:

copy
docker run --rm \
  --env "TZ=Europe/Zurich" \
  --env "IAM_LOG_LEVEL=DEBUG" \
  --env "IAM_MODULES=adminapp,loginapp,transaction-approval,api-policy-service,service-container,h2" \
  -v "$(pwd)/iam:/home/airlock/iam" \
  -p 8443:8443 \
  docker.io/ergon/airlock-iam:8.1

In the docker-compose.yml:

copy
version: '3.7'
services:
  iam:
    image: docker.io/ergon/airlock-iam:8.1 environment:
      - "TZ=Europe/Zurich"
      - "IAM_LOG_LEVEL=DEBUG"
      - "IAM_MODULES=adminapp,loginapp,transaction-approval,api-policy-service,service-container,h2"
    volumes:
      - type: bind
        source: "./iam"
        target: "/home/airlock/iam"
    ports:
      - "8443:8443"