fix(scripts): harden docker-test.sh to be Pipeline-only, add safety docs

This commit is contained in:
null 2026-05-20 22:44:30 -05:00
parent d9bdc4cb3d
commit 2060cf7d85
1 changed files with 14 additions and 4 deletions

View File

@ -1,13 +1,23 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# docker-test.sh — Rebuild and redeploy Pipeline locally from scratch. # docker-test.sh — Rebuild and redeploy Pipeline locally from scratch.
# Cleans only Pipeline Docker resources before building. # Cleans only Pipeline Docker resources before building.
# IMPORTANT: Do not add global Docker cleanup here (for example `docker system prune`). #
# This script must only stop/remove resources for the Pipeline compose project. # SAFETY: This script ONLY operates on the Pipeline compose project.
# It will NOT stop, remove, or prune containers/images/volumes from
# other projects (bill-tracker, open-webui, portainer, scanopy, etc.).
#
# 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.
set -euo pipefail set -euo pipefail
cd "$(git rev-parse --show-toplevel)" cd "$(git rev-parse --show-toplevel)"
echo "=== Stopping and removing Pipeline containers, images, volumes ===" 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 ==="
# Scoped to this compose project only — does NOT affect other containers.
docker compose down --rmi all --volumes --remove-orphans 2>/dev/null || true docker compose down --rmi all --volumes --remove-orphans 2>/dev/null || true
echo "=== Building and starting all containers ===" echo "=== Building and starting all containers ==="
@ -22,4 +32,4 @@ docker compose ps
echo "" echo ""
echo "=== Deploy complete ===" echo "=== Deploy complete ==="
echo 'Frontend: http://localhost:3030' echo 'Frontend: http://localhost:3030'
echo 'Backend: http://localhost:8001' echo 'Backend: http://localhost:8001'