Docker
The docker image contains the following components:
- agosense.symphony application
- Java environment
- PostgreSQL database (Testing purposes only)
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.
#
VolumesUse a volume to persist the content of the database independent of the docker
container. The volume target is /home/db/data
.
#
Environment VariablesName | Description |
---|---|
NUCLEUS_HTTP_ENABLED | Used to enable the plain http port, e.g. when operating behind a reverse proxy that enforces https towards users |
SYMPHONY_JAVA_VM_OPTIONS | Used to apply custom Java VM Options |
SYMPHONY_DB_URL | Used to apply custom db url |
SYMPHONY_DB_USER | Used to apply custom db user |
SYMPHONY_DB_PASSWORD | Used to apply custom password |
#
Docker Compose Configuration Exampleversion: '3.8'services: symphony: container_name: symphony image: agosense/symphony:<version> environment: - SYMPHONY_JAVA_VM_OPTIONS=-Xms1G -Xmx1G - SYMPHONY_DB_URL=jdbc:postgresql://localhost:5432/app - SYMPHONY_DB_User=user - SYMPHONY_DB_PASSWORD=password volumes: - symphony-db-data:/home/db/data - symphony-java-processes:/home/app/bundle/java-processes - symphony-bpel-processes:/home/app/bundle/bpel-processes - ./logback.xml:/home/app/conf/logback.xml ports: - 8443:8443
volumes: symphony-db-data: null
In this example the memory consumption for symphony is set using the according environment variable.
Additionally three volumes are specified:
symphony-db-data
points to docker directory/home/db/data
symphony-java-processes
points to docker directory/home/app/bundle/java-processes
symphony-bpel-processes
points to docker directory/home/app/bundle/bpel-processes
and a single file is mounted to change logging configurations in this case.
For each volume specified docker will create an according local folder (Mountpoint
) where the data is saved to.
Changes to the folders (e.g. adding a new custom process) 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 symphony-java-processes
note
Please do not mount the whole conf directory as this can cause problems when updating to newer versions including updated system config files.
caution
Using the embedded postgres database in production is not supported. Please set up a dedicated external database for this.
#
Docker Networking and LicenseThe 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 DatabaseThe 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
#
Backup and RestoreTo backup data you can use the command pg_dump
. To restore the data psql
can be used.
An example command for dumping the complete symphony database (classic and one) would be:
docker exec -i symphony /home/db/bin/pg_dump -U app app > /dump.sql
PostgreSQL documentation provides a wide range of options to customize the dump e.g. excluding specific tables (like reporting tables) to limit the size of the dumps or splitting the dump file to handle growing database size.
To load the dump back (e.g. in case of a crash of the server) you would follow these steps:
#
Clear existing schemasAssuming symphony is running again, it has created a new empty database initially. Before restoring the existing data you need to remove the existing schemas so they can be recreated based on the dump file. To do so you need to enter the PostgreSQL shell first:
cd /home/dbbin/psql -U app
Next you need to drop the existing schemas:
drop schema public cascade;drop schema symphony_main cascade;
#
Restore dataThen exit the PostgreSQL shell, copy the dump file into the docker container and enter the following command to restore the data:
bin/psql --user app app < /dump.sql
This will recreate the two schemas along with all data that was included in the backup.