Closed chadyred closed 8 years ago
Hello,
It's described into the documentation available here how to link Bonita container to the Official Postgres Container. This way it will ensure to automatically create the corresponding databases.
Link Bonita BPM to a database
PostgreSQL
PostgreSQL is the recommanded database.
Set max_prepared_transactions to 100:
mkdir -p custom_postgres echo '#!/bin/bash' > custom_postgres/bonita.sh echo 'sed -i "s/^._max_preparedtransactions\s=\s(.)$/max_prepared_transactions = 100/" "$PGDATA"/postgresql.conf' >> custom_postgres/bonita.sh chmod +x custom_postgres/bonita.sh
Mount that directory location as /docker-entrypoint-initdb.d inside the PostgreSQL container:
$ docker run --name mydbpostgres -v "$PWD"/custom_postgres/:/docker-entrypoint-initdb.d -e POSTGRES_PASSWORD=mysecretpassword -d postgres:9.3
See the official PostgreSQL documentation for more details.
$ docker run --name bonita_postgres --link mydbpostgres:postgres -d -p 8080:8080 bonita
If you want to manage it by your own, you can do it by overriding the environment variables like this :
cat > /tmp/env.txt <<- EOM
ENSURE_DB_CHECK_AND_CREATION=false
DB_VENDOR=postgres
DB_HOST=172.17.0.2
DB_PORT=5432
DB_NAME=custombonitadb
DB_USER=custombonitauser
DB_PASS=custombonitapass
BIZ_DB_NAME=custombusinessdb
BIZ_DB_USER=custombusinessuser
BIZ_DB_PASS=custombusinesspass
EOM
docker run --name=bonita_7.0.3_postgres --env-file=/tmp/env.txt -d -p 8080:8080 bonita:7.0.3
This way it will launch the Bonita container with the databases and users previously created. Which means in this example that you already have run the following commands :
export PGPASSWORD=mysecretpassword
psql -U postgres -h 172.17.0.2 -d postgres -c "CREATE USER custombonitauser WITH PASSWORD 'custombonitapass';"
psql -U postgres -h 172.17.0.2 -d postgres -c "CREATE DATABASE custombonitadb OWNER custombonitauser;"
psql -U postgres -h 172.17.0.2 -d postgres -c "CREATE USER custombusinessuser WITH PASSWORD 'custombusinesspass';"
psql -U postgres -h 172.17.0.2 -d postgres -c "CREATE DATABASE custombusinessdb OWNER custombusinessuser;"
Thank you it's work fine. I download the Bonita Studio and he have standalone portal, so I use it to test and maybe in a future a full docker to publish and managage app.
Hello !
I have a connection problem here :
Bad idea: docker create with postgres user but no password is required for it...It has no password by default.