Files
familienarchiv/scripts/rebuild-frontend.sh
Marcel 0ef81e20f6
Some checks are pending
CI / Unit & Component Tests (push) Successful in 2m36s
CI / Backend Unit Tests (push) Successful in 2m3s
CI / E2E Tests (push) Has started running
devops: add rebuild-frontend.sh script
Stops the container, removes the stale node_modules volume, and
rebuilds the image. Run this after adding or updating npm dependencies.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 22:39:53 +01:00

22 lines
622 B
Bash
Executable File

#!/usr/bin/env bash
# Rebuilds the frontend Docker container and refreshes the node_modules volume.
# Run this after adding or updating npm dependencies.
set -euo pipefail
cd "$(dirname "$0")/.."
echo "Stopping frontend container..."
docker compose stop frontend
echo "Removing frontend container..."
docker compose rm -f frontend
echo "Removing stale node_modules volume..."
docker volume rm familienarchiv_frontend_node_modules 2>/dev/null || true
echo "Rebuilding image and starting container..."
docker compose up -d --build frontend
echo "Done. Tailing logs (Ctrl+C to exit)..."
docker compose logs -f frontend