System operation with Docker Containers / Docker Compose:
Docker Engine Version 20.10 or higher
Docker Compose Version 1.19 or higher
docker pull docker.stepover.de:8143/webso/frigg docker pull docker.stepover.de:8143/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:
storage_home=/mnt/braga_data/
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:
TZ="EUROPE/BERLIN"
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
#frigg docker run -p 8443:8443 --env TZ="EUROPE/BERLIN" --volume /path/to/config.ini:/usr/local/tomcat/conf/config.ini --name frigg docker.stepover.de:8143/webso/frigg #braga docker run -p 8083:8080 --env TZ="EUROPE/BERLIN" --volume /path/to/config.ini:/opt/braga/config.ini --volume /path/to/datadir:/mnt/braga_data --name braga docker.stepover.de:8143/webso/braga
braga can be referenced by its container ip or the server ip with port-forwarding. The container ip can be obtained with docker inspect:
docker inspect braga
The server port is the port of the container in the docker bridge network. The axis_server_ip must be set accordingly:
axis_server_ip=172.18.0.2 axis_server_port=8080
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
docker run --add-host=host.docker.internal:host-gateway
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
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
services: frigg: image: "docker.stepover.de:8143/webso/friggdev:latest_snapshot" container_name: frigg expose: - "8443" ports: - "8443:8443" networks: - "webso-net" volumes: - "/path/to/config.ini:/usr/local/tomcat/conf/config.ini" environment: - TZ=Europe/Berlin braga: image: "docker.stepover.de:8143/webso/bragadev:v8017.a74f7db56.SNAPSHOT" container_name: braga expose: - "8080" ports: - "8083:8080" networks: - "webso-net" volumes: - "/path/to/conig.ini:/opt/braga/config.ini" - "/path/to/braga_data:/mnt/braga_data" environment: - TZ=Europe/Berlin networks: webso-net: name: "webso-net"
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
axis_server_ip=braga axis_server_port=8080 storage_home=/mnt/braga_data database_host=<IP> rabbit_mq_server=<IP>
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.