devops: add rebuild-frontend.sh script
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

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>
This commit is contained in:
Marcel
2026-03-23 22:34:45 +01:00
parent 1ad8fffd1b
commit 0ef81e20f6

21
scripts/rebuild-frontend.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/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