File tree Expand file tree Collapse file tree 4 files changed +29
-4
lines changed
Expand file tree Collapse file tree 4 files changed +29
-4
lines changed Original file line number Diff line number Diff line change 1+ pg-db-data
Original file line number Diff line number Diff line change 1- # FROM postgres:12
2- FROM bitnami/postgresql
1+ FROM postgres:12
2+ # FROM bitnami/postgresql
33COPY create-multiple-postgresql-databases.sh /docker-entrypoint-initdb.d/
Original file line number Diff line number Diff line change 66function create_user_and_database() {
77 local database=$1
88 echo " Creating user and database '$database '"
9- psql -v ON_ERROR_STOP=1 --username " $POSTGRESQL_USERNAME " << -EOSQL
9+ psql -v ON_ERROR_STOP=1 --username " $POSTGRES_USER " << -EOSQL
1010 CREATE DATABASE $database ;
11- GRANT ALL PRIVILEGES ON DATABASE $database TO $POSTGRESQL_USERNAME ;
11+ GRANT ALL PRIVILEGES ON DATABASE $database TO $POSTGRES_USER ;
1212EOSQL
1313}
1414
Original file line number Diff line number Diff line change 1+ version : ' 3'
2+
3+ volumes :
4+ postgres :
5+
6+ services :
7+ postgresql :
8+ restart : always
9+ image : irobbierobinson/multi-postgres:latest
10+ volumes :
11+ - ./pg-db-data:/bitnami/postgresql
12+ environment :
13+ - POSTGRES_PASSWORD=postgres
14+ - POSTGRES_USER=postgres
15+ - POSTGRES_DB=postgres
16+ - POSTGRES_MULTIPLE_DATABASES=keycloak,bpm
17+ ports :
18+ - 5432:5432
19+ networks :
20+ - backend
21+ networks :
22+ backend :
23+ driver : bridge
24+
You can’t perform that action at this time.
0 commit comments