Pre-configured Postgres database image to work with Bonita
10K+
This image is based on the official Postgres image.
The property max_prepared_transactions is required by Bonita and is set to 100.
This image is configured with the two databases required by Bonita:
bonita (connection user bonita, password bpm)business_data (connection user business_data, password bpm)docker run -d --name bonita-postgres -p 5432:5432 bonitasoft/bonita-postgres:15.3
docker run -d \
--name bonita-postgres \
-p 5432:5432 \
-v /my/postgres/datadir:/var/lib/postgresql/data \
bonitasoft/bonita-postgres:15.3
docker run -d \
--name bonita-postgres \
-p 5432:5432 \
-v /my/postgres/datadir:/var/lib/postgresql/data \
-v /my/sql/folder:/opt/bonita/sql \
bonitasoft/bonita-postgres:15.3
docker exec -it bonita-postgres bash
docker logs bonita-postgres
It will restore dumps present in the volume /opt/bonita/dump
For plain text sql form, dumps must be named bonita.dump and business_data.dump
Create those dump using:
pg_dump -h localhost -p 5432 -Ubonita bonita > /opt/bonita/dump/bonita.dump
pg_dump -h localhost -p 5432 -Ubusiness_data business_data > /opt/bonita/dump/business_data.dump
For compressed format, dumps must be named bonita.pgdump and business_data.pgdump. This format is used with a .list
file that allow to whitelist items to restore:
# --quote-all-identifiers : ensure no issues with bonita columns name that use a PostgreSQL reserved word
# --encoding=utf8 : required
# -F c : use PostgreSQL compress format
pg_dump -h localhost -p 5432 -U bonita --quote-all-identifiers --encoding=utf8 -F c bonita > /opt/bonita/dump/bonita.pgdump
# prepare white-list file for pg_restore
# this will read backup file and generate a TOC (Table Of Content) stored in a white list file
# then edit this file to comment with a `;` items you don't want to restore
pg_restore -l /opt/bonita/dump/bonita.pgdump > /opt/bonita/dump/bonita.list
# same for BDM
pg_dump -h localhost -p 5432 -U business_data --quote-all-identifiers --encoding=utf8 -F c business_data > /opt/bonita/dump/business_data.pgdump
pg_restore -l /opt/bonita/dump/business_data.pgdump > /opt/bonita/dump/business_data.list
Then run the docker using volume -v /my/postgres/dump:/opt/bonita/dump
Note: if container already exists, it must be removed, using `docker rm <CONTAINER_ID>`, unless restore will not be applied
-e POSTGRES_PASSWORD=mysecretpassword, in order to be able to access the tables with a known
user (postgres) and passworddocker run -d --name postgres-from-dump -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -v /my/postgres/dump:/opt/bonita/dump bonitasoft/bonita-postgres:15.3
docker exec -it postgres-from-dumppsql -U postgres bonita < ./my_dump_file.sqlSee docker-compose.yml or docker-compose-community.yml for an example on how to test this image using a Bonita Docker image.
To execute it:
docker-compose up --build -d
# OR
docker-compose -f docker-compose-community.yml up --build -d
To shut it down and clear your environment:
docker-compose down -v --remove-orphans
Content type
Image
Digest
sha256:7ea0713c5…
Size
92.4 MB
Last updated
almost 2 years ago
docker pull bonitasoft/bonita-postgres