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>
This commit is contained in:
21
scripts/rebuild-frontend.sh
Executable file
21
scripts/rebuild-frontend.sh
Executable 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
|
||||
Reference in New Issue
Block a user