Restarts WitchCityRope Docker TEST containers using the CORRECT procedure. Handles shutdown, rebuild with test compose overlay (--no-cache by default), health checks, and verification...
Purpose: Restart Docker TEST containers the RIGHT way - this is the ONLY correct procedure.
CRITICAL: This skill is for TEST containers only. For DEVELOPMENT containers, use restart-dev-containers skill.
When to Use:
When NOT to Use:
restart-dev-containers instead--skip-rebuild flagCRITICAL: Dev and test containers are isolated using different project names:
-p witchcityrope-dev-p witchcityrope-testThis prevents operations on one environment from affecting the other.
This skill is the ONLY place where test container restart procedure is documented.
If you find container restart instructions elsewhere:
DO NOT duplicate this procedure in:
# WRONG - Missing test overlay
docker-compose up -d
# WRONG - Missing project name (will interfere with dev containers)
docker-compose -f docker-compose.yml -f docker-compose.test.yml up -d
# WRONG - Not using --no-cache for clean test builds
docker-compose -p witchcityrope-test -f docker-compose.yml -f docker-compose.test.yml up -d --build
Use this skill - it handles everything correctly including project isolation and --no-cache.
Executable Script: execute.sh
# From project root - clean rebuild with --no-cache (default, ensures fresh test files)
bash .claude/skills/restart-test-containers/execute.sh
# Skip confirmation prompt (for automation)
SKIP_CONFIRMATION=true bash .claude/skills/restart-test-containers/execute.sh
# Skip rebuild - just restart existing containers (fastest, when code hasn't changed)
bash .claude/skills/restart-test-containers/execute.sh --skip-rebuild
# Use Docker cache for faster rebuilds (when only non-test code changed)
bash .claude/skills/restart-test-containers/execute.sh --use-cache
# Combine flags for automation without rebuild
SKIP_CONFIRMATION=true bash .claude/skills/restart-test-containers/execute.sh --skip-rebuild
What the script does:
-p witchcityrope-test)docker-compose.yml + docker-compose.test.yml)--no-cache for clean test images--use-cache: Uses Docker cache for faster builds--skip-rebuild: Skips build entirely, just starts containersScript includes safety checks - it will not run blindly without showing you what it's about to do.
# From project root - clean rebuild with --no-cache (default)
bash .claude/skills/restart-test-containers/execute.sh
# For quick restart without rebuild (code hasn't changed)
bash .claude/skills/restart-test-containers/execute.sh --skip-rebuild
# For faster rebuild using Docker cache (when only non-test files changed)
bash .claude/skills/restart-test-containers/execute.sh --use-cache
# For automation - skip confirmation
SKIP_CONFIRMATION=true bash .claude/skills/restart-test-containers/execute.sh
# CRITICAL: Always use -p witchcityrope-test to avoid affecting dev containers!
# Stop containers
docker-compose -p witchcityrope-test -f docker-compose.yml -f docker-compose.test.yml down -v
# Start with test overlay and --no-cache
docker-compose -p witchcityrope-test -f docker-compose.yml -f docker-compose.test.yml up -d --build --no-cache
# Wait and check health
sleep 20
docker exec witchcity-api-test curl -f http://localhost:8080/health
docker exec witchcity-web-test curl -f http://localhost:5173
Cause: Compilation errors in container or health not ready
Solution: Skill automatically checks container health. If issues persist, check container logs for errors in witchcity-web-test and witchcity-api-test.
Cause: Old networks from previous runs or different subnets conflicting
Solution:
# Remove old test networks
docker network ls | grep witchcity | awk '{print $1}' | xargs docker network rm 2>/dev/null
# Try again
bash .claude/skills/restart-test-containers/execute.sh
Cause: Dev containers or other process using same ports
Note: Test containers do NOT expose ports externally (internal communication only). This error usually means dev containers are on conflicting networks.
Solution: Check if dev containers are running (they should be fine to run alongside). If network conflicts occur, prune unused Docker networks.
Cause: Missing -p witchcityrope-test flag
Solution: Always use this skill or ensure the project flag is included
The test-environment skill calls restart-test-containers with --skip-rebuild when containers are already healthy, or without the flag when a fresh build is needed.
# test-environment internally calls:
bash .claude/skills/restart-test-containers/execute.sh --skip-rebuild
For development work, use the dev container skill which uses -p witchcityrope-dev project isolation.
When run via Claude Code, skill returns:
{
"skill": "restart-test-containers",
"status": "success",
"timestamp": "2025-12-01T15:30:00Z",
"containers": {
"running": 5,
"expected": 5,
"healthy": true
},
"build": {
"mode": "full",
"no_cache": true
},
"healthChecks": {
"web": "healthy",
"api": "healthy",
"database": "healthy",
"test_runner": "healthy"
},
"readyForTesting": true,
"message": "Test environment ready"
}
On failure:
{
"skill": "restart-test-containers",
"status": "failure",
"error": "Container health check failed",
"details": "API service did not respond within timeout",
"action": "Check API container logs for errors"
}
-p witchcityrope-dev)This skill is the single source of truth for TEST container restart.
To update the restart procedure:
-p witchcityrope-test project isolation--no-cache for clean test images--skip-rebuild flag for faster restartsRemember: This skill is executable automation. Run it, don't copy it.