From 136094da5bf7d6caf69daa0045045dcbe723266e Mon Sep 17 00:00:00 2001
From: Matthew Baggett <matthew@baggett.me>
Date: Mon, 3 Mar 2025 14:35:08 +0100
Subject: [PATCH] Fix bug with PGDATA location

---
 products/postgres/outputs.tf  | 2 --
 products/postgres/postgres.tf | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/products/postgres/outputs.tf b/products/postgres/outputs.tf
index abe84ed..0e34359 100644
--- a/products/postgres/outputs.tf
+++ b/products/postgres/outputs.tf
@@ -16,11 +16,9 @@ output "ports" {
 output "docker_service" {
   value = module.service.docker_service
 }
-
 output "endpoint" {
   value = "postgres://${local.username}:${local.password}@${module.service.service_name}:5432/${local.database}"
 }
-
 output "pgadmin_config" {
   value = {
     "Group"         = var.stack_name
diff --git a/products/postgres/postgres.tf b/products/postgres/postgres.tf
index 694d87f..a1a2578 100644
--- a/products/postgres/postgres.tf
+++ b/products/postgres/postgres.tf
@@ -12,7 +12,7 @@ module "service" {
     POSTGRES_USER     = local.username
     POSTGRES_PASSWORD = local.password
     POSTGRES_DB       = local.database
-    PGDATA            = "/var/lib/postgres/data"
+    PGDATA            = "/var/lib/postgres/data/pgdata"
   }
   volumes               = local.volumes
   mounts                = local.mounts