From 9d08557f14185b73980cf1c328a85a62f047b438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 14 Sep 2023 16:11:08 +0200 Subject: [PATCH] Fix database initialization The PG environment variable can't be set to the database container --- .../create/{{cookiecutter.project}}/docker-compose-lib.yaml | 3 --- .../create/{{cookiecutter.project}}/scripts/db-backup | 2 +- .../create/{{cookiecutter.project}}/scripts/db-restore | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose-lib.yaml b/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose-lib.yaml index 184640bc4a..34f0eb1420 100644 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose-lib.yaml +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose-lib.yaml @@ -482,9 +482,6 @@ services: db: image: camptocamp/postgres:${POSTGRES_TAG} environment: - - PGUSER - - PGPASSWORD - - PGDATABASE - POSTGRES_PASSWORD=${PGPASSWORD} - POSTGRES_DB=${PGDATABASE} - POSTGRES_USER=${PGUSER} diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/scripts/db-backup b/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/scripts/db-backup index b908779d08..faedb3ce8e 100755 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/scripts/db-backup +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/scripts/db-backup @@ -92,7 +92,7 @@ def main() -> None: "docker-compose", "exec", "-T", - "db", + "tools", "bash", "-c", 'pg_dump --format=c --dbname="$PGDATABASE"', diff --git a/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/scripts/db-restore b/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/scripts/db-restore index 40e30a6885..7412cd801d 100755 --- a/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/scripts/db-restore +++ b/geoportal/c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/scripts/db-restore @@ -97,7 +97,7 @@ def main() -> None: + [ "exec", "-T", - "db", + "tools", "bash", "-c", 'pg_restore --dbname="$PGDATABASE" ' + " ".join(args.arg),