k) Docker setup

  • System operation with Docker Containers / Docker Compose:

  • Docker Engine Version 20.10 or higher

  • Docker Compose Version 1.19 or higher

The correct 'docker pull' commands will be provided, and the image names must be replaced in the commands and configurations accordingly.

docker pull docker.stepover.de/webso/frigg docker pull docker.stepover.de/webso/braga #optional docker pull mariadb:latest docker pull

Environement variables and Volumes

config.ini

For frigg the config.ini must be mounted to /usr/local/tomcat/conf/config.ini

For braga the config.ini must be mounted to /opt/braga/config.ini

/path/to/config.ini:/usr/local/tomcat/conf/config.ini /path/to/config.ini:/opt/braga/config.ini

braga storage

For braga additionally the data directory must be mounted. E.g.

/path/to/datadir:/mnt/braga_data

The data directory must be defined accordingly in the config.ini:

The volumes can either be mounted by using volumes in docker-compose or with the -v flag in docker run command (see below).

timezone

Set the timezone for frigg and braga:

If no timezone is provided, UTC will be used. The timezone of the database must be the same as frigg and braga. The environment variable can either be set using environment in docker-compose or with the -e flag in docker run.

Docker run

When running the containers, the mounted volumes and environment variables must be set in the run command:

docker run

braga can be referenced by its container ip or the server ip with port-forwarding. The container ip can be obtained with docker inspect:

The server port is the port of the container in the docker bridge network. The axis_server_ip must be set accordingly:

docker network

To make the services accessible wihtin by name, you need to create a docker network.

The network must be added to the run command with the --network parameter.

docker run with docker network:

braga can then be referenced by it’s container name and it’s container port.

config.ini with docker network:

The referenced port is not the port exposed with the run command, but the port of the container. (8080 for braga).

mariaDB and rabbitMQ container

Additionally you can run mariaDB and/or rabbitMQ as containers. To reference them by their names, a docker network must be created (see above).

docker run with mariaDB and rabbitMQ:

The services are now reachable with their name within the docker network and can be set in the config.ini accordingly.

config.ini with docker mariaDB and rabbitMQ

host database

A database running on the host system can be accessed with host.docker.internal from a container.

It may be neccessary to add the host when running the container on linux

It’s not necessary to run the mariadb container. When using a docker network, --network needs to be added (see above).

docker run with host network

without docker network:

with docker network:

 

config.ini with database on host:

Docker compose

Instead of using the docker run command, the services can be defined with docker-compose. The docker compose file creates a network webso-net and starts the services frigg and braga. The environment variables (see above) are set in the compose file.

docker-compose.yaml

Braga is referenced by it’s container name in config.ini. The braga storage_home is mounted as a volume and must be referenced in config.ini accordingly.

config.ini

mariaDB and rabbitMQ container (docker-compose)

Instead of referencing the database and rabbitMQ by their IP, you can run them containerized and reference them by their container_name. The services must be added to the docker-compose.yaml file. mariaDB is running on it’s default port 3306 and the data is mounted from the host system.

host database (docker-compose)

To use a database running on a host system instead of a container, “host.docker.internal” must be added to extra_hosts. The mariadb service definition is not neccessary. The database host in config.ini must be set to host.docker.internal.

TyrService Cache

When using the TyrService Cache, the cache-port of the frigg containers defined in the config tyr_cache_port (default 1110) must be exposed.

For additional information see l) TyrService Cache

Local tyrservice testing

When testing the Tyrservice Integration with frigg running locally, there may be problems with the SSL certificate, since certificate authorites don’t issue trusted certificates for localhost.

Therefore your Tyrservice client must either accept all certificates withoch checking the host.

Alternatively we can provide a certificate for testing. The host of the certificate must then be added in the hosts file.