Skip to main content
Version: 3.5.2

Docker

The docker image contains the following components:

  • agosense.symphony application
  • Java environment
  • PostgreSQL database

The docker image is published through docker hub https://hub.docker.com/r/agosense/symphony/tags , the image name is agosense/symphony and tags are created for each release.

Volumes#

Use a volume to persist the content of the database independent of the docker container. The volume target is /home/db/data.

An additional volume is advisable for the target /home/app/conf to make sure configuration changes are also persisted outside the container.

Environment Variables#

NameDescription
NUCLEUS_HTTP_ENABLEDUsed to enable the plain http port, e.g. when operating behind a reverse proxy that enforces https towards users
SYMPHONY_JAVA_VM_OPTIONSUsed to apply custom Java VM Options

Docker Compose Configuration Example#

version: '3.8'services:  symphony:    container_name: symphony    image: agosense/symphony:<version>    environment:      - SYMPHONY_JAVA_VM_OPTIONS=-Xms1G -Xmx1G    volumes:      - symphony-db-data:/home/db/data      - symphony-conf:/home/app/conf    ports:      - 8443:8443
volumes:  symphony-db-data: null  symphony-conf: null

In this example the memory consumption for symphony is set using the according environment variable.

Additionally two volumes are specified:

  • symphony-db-data points to docker directory /home/db/data
  • symphony-conf points to docker directory /home/app/conf

For each volume specified docker will create an according local folder (Mountpoint) where the data is saved to. Changes to the folders (e.g. changing the logback.xml to activate a specific logger) are reflected inside the docker accordingly.

You can list all docker volumes using the following command:

docker volume ls

To find out the local folder (Mountpoint) that docker created for the volume you can use the following command:

docker volume inspect docker_symphony-conf

Docker Networking and License#

The docker container engine acts as a DHCP server for the containers and their assignemnt to ip addresses.

To prevent symphonys activation hash from changing randomly, you should make sure to connect the container to a predefined network and define a fixed ip address.

Add this directly under the symphony service configuration:

   networks:      symphony:        ipv4_address: 172.31.0.2

Add this to the global configuration:

networks:  symphony:    name: symphony

PostgreSQL Database#

The docker image always includes an up-to-date version of the PostgreSQL database. The database installation itself is located in the /home/db folder in the docker image.

If you wish to execute SQL commands you can enter the docker container like:

docker exec -it symphony bash

This will open the shell inside the docker container, now run the following commands to enter the PostgreSQL shell:

cd /home/dbbin/psql -U app

This will connect the database with the default user app. When prompted for the password type in agosensegmbh. You can now use the PostgreSQL shell to execute SQL commands. See PostgreSQL documentation for further details.

The database used is also called app

You can of course also use the command pg_dump to backup and pg_restore restore data.

An example command for dumping just the synchronization tables is:

bin/pg_dump --username=app -t symphony_main.syncs app > /dump.sql

To load the dump back you would run the following command:

bin/psql --user app app < /dump.sql