2026-05-20 22:30:37 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
# docker-test.sh — Rebuild and redeploy Pipeline locally from scratch.
|
2026-05-20 22:37:36 -05:00
|
|
|
# Cleans only Pipeline Docker resources before building.
|
2026-05-20 22:44:30 -05:00
|
|
|
#
|
|
|
|
|
# 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.
|
2026-05-20 22:30:37 -05:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
|
|
|
|
2026-05-20 22:44:30 -05:00
|
|
|
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.
|
2026-05-20 22:30:37 -05:00
|
|
|
docker compose down --rmi all --volumes --remove-orphans 2>/dev/null || true
|
|
|
|
|
|
|
|
|
|
echo "=== Building and starting all containers ==="
|
|
|
|
|
docker compose up --build -d
|
|
|
|
|
|
|
|
|
|
echo "=== Waiting for services to be healthy ==="
|
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
|
|
echo "=== Checking container status ==="
|
|
|
|
|
docker compose ps
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "=== Deploy complete ==="
|
2026-05-20 22:37:36 -05:00
|
|
|
echo 'Frontend: http://localhost:3030'
|
2026-05-20 22:44:30 -05:00
|
|
|
echo 'Backend: http://localhost:8001'
|