From b2aa189c2ff59a72cc7beff65a883c20b693c871 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 27 Sep 2024 09:40:54 -0700 Subject: [PATCH] Upgrade Postgres from 12.5 to 17-bullseye Add second volume mount for old data. ignore-skip ignore-skip ignore-skip --- compose.yml | 1 + database/.docker/db/Dockerfile.setup | 5 ++++- database/.pipeline/templates/db.dc.yaml | 4 +++- env_config/env.docker | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/compose.yml b/compose.yml index 8d1955a247..856149ac2f 100644 --- a/compose.yml +++ b/compose.yml @@ -23,6 +23,7 @@ services: - POSTGRES_PASSWORD=${DB_ADMIN_PASS} - POSTGRES_DB=${DB_DATABASE} - PORT=5432 + - PGDATA=${PG_DATA} networks: - sims-network volumes: diff --git a/database/.docker/db/Dockerfile.setup b/database/.docker/db/Dockerfile.setup index 40c77c4659..0b04dec12b 100644 --- a/database/.docker/db/Dockerfile.setup +++ b/database/.docker/db/Dockerfile.setup @@ -22,4 +22,7 @@ RUN npm ci --include=dev USER 1001 # run the database migrations and seeding -CMD [ "npm", "run", "setup" ] +# CMD [ "npm", "run", "setup" ] + +# TODO - Temporarily disable the dockerfile from running the setup script +CMD ["echo", "Done"] diff --git a/database/.pipeline/templates/db.dc.yaml b/database/.pipeline/templates/db.dc.yaml index 01e89c8884..5baadb071c 100644 --- a/database/.pipeline/templates/db.dc.yaml +++ b/database/.pipeline/templates/db.dc.yaml @@ -47,7 +47,7 @@ parameters: value: 'biohubbc' - name: PGDATA description: Path to PostgreSQL data directory - value: '/var/lib/pgsql/data/userdata' + value: '/var/lib/postgresql/data/17' required: false - name: TZ description: Database timezone @@ -197,6 +197,8 @@ objects: securityContext: {} terminationMessagePath: '/dev/termination-log' volumeMounts: + - name: '${DATABASE_SERVICE_NAME}-data' + mountPath: '/var/lib/postgresql/data' - name: '${DATABASE_SERVICE_NAME}-data' mountPath: '/var/lib/pgsql/data' # - name: '${DATABASE_SERVICE_NAME}-run' diff --git a/env_config/env.docker b/env_config/env.docker index 5f5d799405..d4a6eaffe1 100644 --- a/env_config/env.docker +++ b/env_config/env.docker @@ -138,6 +138,7 @@ DB_DATABASE=biohubbc DB_SCHEMA=biohub DB_SCHEMA_DAPI_V1=biohub_dapi_v1 DB_TZ=America/Vancouver +PG_DATA=/var/lib/postgresql/data/17 # ------------------------------------------------------------------------------ # KeyCloak Configuration for Keycloak Common Hosted Single Sign-on (CSS)