From 328d71b0f805ce020df341cb758dac59682b0476 Mon Sep 17 00:00:00 2001 From: null Date: Wed, 20 May 2026 22:53:55 -0500 Subject: [PATCH] fix(scripts): preserve DB volume across rebuilds, stop nuking data --- scripts/docker-test.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/docker-test.sh b/scripts/docker-test.sh index 9a88c44..cff1815 100755 --- a/scripts/docker-test.sh +++ b/scripts/docker-test.sh @@ -9,16 +9,20 @@ # IMPORTANT: Do not add global Docker cleanup here (e.g. `docker system prune`, # `docker image prune`, `docker volume prune`). Those commands operate on # ALL Docker resources system-wide and will destroy other running services. +# +# DATA PERSISTENCE: The postgres database volume is preserved across rebuilds. +# Only app containers/images are cycled. DB data (gateways, keys, etc.) survives. set -euo pipefail cd "$(git rev-parse --show-toplevel)" PROJECT_NAME="$(docker compose config --format '{{.Name}}' 2>/dev/null || echo 'pipeline')" echo "=== Compose project: ${PROJECT_NAME} ===" -echo "=== Stopping and removing ONLY ${PROJECT_NAME} containers, images, volumes ===" +echo "=== Stopping ${PROJECT_NAME} containers (preserving database volume) ===" -# Scoped to this compose project only — does NOT affect other containers. -docker compose down --rmi all --volumes --remove-orphans 2>/dev/null || true +# Stop and remove containers only — no --volumes (preserve postgres data), +# no --rmi all (preserve pulled base images). Just rebuild the app images. +docker compose down --remove-orphans 2>/dev/null || true echo "=== Building and starting all containers ===" docker compose up --build -d