19aeb2ba04
CI / Lint (push) Successful in 3m4s
CI / Typecheck (push) Successful in 3m6s
CI / Architecture Guardrails (push) Successful in 3m8s
CI / Assistant Split Regression (push) Successful in 3m48s
CI / Build (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Fresh-Linux Docker Deploy (push) Has been cancelled
CI / Release Images (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
rename(phase 3): compose/DB/infra + stray code refs capakraken → nexus (#62) Co-authored-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com> Co-committed-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com>
51 lines
1.8 KiB
Bash
Executable File
51 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# restart.sh — Rebuild the CapaKraken app container from scratch.
|
|
#
|
|
# When to use:
|
|
# - After changing pnpm-lock.yaml (new/removed dependencies)
|
|
# - After Prisma schema changes
|
|
# - After Dockerfile.dev changes
|
|
# - When you see "Cannot find module" errors in the app container
|
|
#
|
|
# A plain `docker compose restart` only restarts the existing container — it
|
|
# does NOT rebuild the image or reinstall dependencies.
|
|
#
|
|
# How it works:
|
|
# The startup script (tooling/docker/app-dev-start.sh) runs `pnpm install`
|
|
# at boot to reconcile host-side workspace symlinks with the container's
|
|
# pnpm store in the named volume. This script rebuilds the Docker image
|
|
# (which re-runs pnpm install into the image layer), then optionally purges
|
|
# stale named volumes so the startup install starts fresh.
|
|
#
|
|
# Usage:
|
|
# ./restart.sh # rebuild app image and restart
|
|
# ./restart.sh --clean # also remove node_modules + .next volumes
|
|
# ./restart.sh --full # --clean + recreate all services (postgres, redis, etc.)
|
|
|
|
set -euo pipefail
|
|
|
|
PROFILE="full"
|
|
SERVICES="app"
|
|
CLEAN=false
|
|
|
|
for arg in "$@"; do
|
|
case "$arg" in
|
|
--clean) CLEAN=true ;;
|
|
--full) CLEAN=true; SERVICES="" ;; # empty = all services in the profile
|
|
esac
|
|
done
|
|
|
|
echo "==> Stopping app container..."
|
|
docker compose --profile "$PROFILE" stop app 2>/dev/null || true
|
|
|
|
if $CLEAN; then
|
|
echo "==> Removing stale node_modules and .next volumes..."
|
|
docker volume rm nexus_node_modules nexus_next 2>/dev/null || true
|
|
fi
|
|
|
|
echo "==> Rebuilding and starting ($( [[ -z "$SERVICES" ]] && echo "all services" || echo "$SERVICES" ))..."
|
|
docker compose --profile "$PROFILE" up --build -d $SERVICES
|
|
|
|
echo "==> Tailing logs (Ctrl-C to detach)..."
|
|
docker compose --profile "$PROFILE" logs -f app
|