From 669194e9e5a5e4eaf399e63a0ceb39e232515e02 Mon Sep 17 00:00:00 2001 From: Aris Ripandi Date: Thu, 5 Sep 2024 10:14:05 +0700 Subject: [PATCH] chore: refine pgsql-multudb docker compose --- docker-compose.yml | 2 +- scripts/pgsql-multidb.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index bac117c..17a3497 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: securedb - POSTGRES_MULTIPLE_DATABASES: remixdb,extradb + POSTGRES_DATABASES: remixdb,extradb command: ['postgres', '-c', 'wal_level=logical'] healthcheck: test: ['CMD-SHELL', 'pg_isready -U postgres -d remixdb'] diff --git a/scripts/pgsql-multidb.sh b/scripts/pgsql-multidb.sh index 3e8d5df..4198dd0 100755 --- a/scripts/pgsql-multidb.sh +++ b/scripts/pgsql-multidb.sh @@ -13,9 +13,9 @@ function create_user_and_database() { EOSQL } -if [ -n "$POSTGRES_MULTIPLE_DATABASES" ]; then - echo "Multiple database creation requested: $POSTGRES_MULTIPLE_DATABASES" - for db in $(echo $POSTGRES_MULTIPLE_DATABASES | tr ',' ' '); do +if [ -n "$POSTGRES_DATABASES" ]; then + echo "Multiple database creation requested: $POSTGRES_DATABASES" + for db in $(echo $POSTGRES_DATABASES | tr ',' ' '); do create_user_and_database $db done echo "Multiple databases created"