Docker Cleanup and Organization Guide
Version Management
Sasha Studio now uses semantic versioning for all Docker builds:
Version System
- VERSION file: Single source of truth at
/sasha/VERSION - Automatic sync: package.json updated automatically
- Docker tags: Multiple tags created per version (1.0.0, 1.0, 1, latest)
- UI display: Version shown in Settings > Version tab
Managing Versions
# Check current version
./scripts/version.sh current
# Bump versions
./scripts/version.sh patch # Bug fixes: 1.0.0 -> 1.0.1
./scripts/version.sh minor # Features: 1.0.0 -> 1.1.0
./scripts/version.sh major # Breaking: 1.0.0 -> 2.0.0
# Build with version tags
cd claudecodeui
./scripts/docker-build.sh production
Docker Image Tags
For version 1.0.0, these tags are created:
sasha-studio:1.0.0(exact version)sasha-studio:1.0(major.minor)sasha-studio:1(major only)sasha-studio:latest(current stable)sasha-studio:production(environment)
Current Situation
You have multiple Docker containers from different projects:
- Sasha (claudecodeui) - Your AI knowledge management system
- NudgeCampaign (multiple versions: v2, v3, v4) - Different project
- WMPG-Signature-Server - Signature service project
- Juno-Quickbase-API - API project
All containers are currently stopped, which is good for cleanup.
π§Ή Step 1: Clean Up Old Containers
Remove all stopped containers from other projects:
# Remove all NudgeCampaign containers
docker rm nudgecampaign-mvp-v4-app-1
docker rm nudgecampaign-mvp-v4-supabase-studio-1
docker rm nudgecampaign-mvp-v4-supabase-kong-1
docker rm nudgecampaign-mvp-v4-n8n-1
docker rm nudgecampaign-mvp-v4-supabase-auth-1
docker rm nudgecampaign-mvp-v4-supabase-rest-1
docker rm nudgecampaign-mvp-v4-supabase-meta-1
docker rm nudgecampaign-mvp-v4-maildev-1
docker rm nudgecampaign-mvp-v4-supabase-db-1
docker rm nudgecampaign-mvp-v4-redis-1
docker rm nudgecampaign-mvp-v2-postgres-1
# Remove sasha-test container
docker rm sasha-test
Or remove ALL stopped containers at once:
docker container prune -f
Step 2: Set Up Sasha Properly
A. Create Sasha Docker Setup (if not exists)
cd /Users/lindsaysmith/Documents/lambda1.nosync/sasha/claudecodeui
# Check if docker-compose.yml exists
cat docker-compose.yml
B. Create/Update docker-compose.yml for Sasha:
version: '3.8'
services:
sasha-frontend:
container_name: sasha-frontend
build: .
ports:
- "3001:3001" # Sasha frontend
environment:
- NODE_ENV=development
- VITE_API_URL=http://localhost:3001
volumes:
- ./src:/app/src
- ./server:/app/server
- ./uploads:/app/uploads
- sasha-workspace:/workspace
command: npm run dev
networks:
- sasha-network
# Optional: Sasha Database (if needed)
sasha-db:
container_name: sasha-db
image: postgres:15
ports:
- "5433:5432" # Different port to avoid conflicts
environment:
- POSTGRES_DB=sasha
- POSTGRES_USER=sasha
- POSTGRES_PASSWORD=sasha_secure_password
volumes:
- sasha-db-data:/var/lib/postgresql/data
networks:
- sasha-network
volumes:
sasha-workspace:
name: sasha-workspace
sasha-db-data:
name: sasha-db-data
networks:
sasha-network:
name: sasha-network
π¦ Step 3: Port Management Strategy
To avoid confusion, assign specific port ranges to each project:
| Project | Service | Port | URL |
|---|---|---|---|
| Sasha | Frontend | 3001 | http://localhost:3001 |
| Sasha | Database | 5433 | postgres://localhost:5433 |
| Sasha | WebSocket | 3002 | ws://localhost:3002 |
| --- | --- | --- | --- |
| NudgeCampaign | App | 3010 | http://localhost:3010 |
| NudgeCampaign | Supabase | 54323 | http://localhost:54323 |
| --- | --- | --- | --- |
| Other Projects | Start at | 4000+ | http://localhost:4xxx |
Step 4: Docker Commands Cheat Sheet
For Sasha Development:
# Start Sasha only
cd /Users/lindsaysmith/Documents/lambda1.nosync/sasha/claudecodeui
docker-compose up -d
# View Sasha logs
docker-compose logs -f sasha-frontend
# Stop Sasha
docker-compose down
# Restart Sasha
docker-compose restart
# Check Sasha status
docker ps | grep sasha
Clean Up Commands:
# See what's running
docker ps
# See all containers (including stopped)
docker ps -a
# Stop all running containers
docker stop $(docker ps -q)
# Remove all stopped containers
docker container prune -f
# Remove unused images
docker image prune -f
# Remove unused volumes (BE CAREFUL - this deletes data!)
docker volume prune -f
# Nuclear option - clean everything (CAREFUL!)
docker system prune -a --volumes -f
Step 5: Container Naming Convention
Use clear, project-prefixed names:
sasha-frontendsasha-backendsasha-dbsasha-redissasha-websocket
This makes it immediately clear what's running:
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
Step 6: Quick Status Script
Create a status script at /Users/lindsaysmith/Documents/lambda1.nosync/sasha/scripts/docker-status.sh:
#!/bin/bash
echo "=== SASHA Docker Status ==="
echo ""
echo "π³ Running Containers:"
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" | grep sasha || echo "No Sasha containers running"
echo ""
echo "π Sasha Volumes:"
docker volume ls | grep sasha
echo ""
echo "π Sasha Networks:"
docker network ls | grep sasha
echo ""
echo "π Access URLs:"
echo " Frontend: http://localhost:3001"
echo " Database: postgres://localhost:5433"
echo ""
Make it executable:
chmod +x /Users/lindsaysmith/Documents/lambda1.nosync/sasha/scripts/docker-status.sh
Step 7: Development Workflow
Option A: Docker for Everything
cd /Users/lindsaysmith/Documents/lambda1.nosync/sasha/claudecodeui
docker-compose up -d
open http://localhost:3001
Option B: Local Node + Docker for Services
# Run database in Docker
docker-compose up -d sasha-db
# Run app locally
npm run dev
Option C: No Docker (Simplest for now)
cd /Users/lindsaysmith/Documents/lambda1.nosync/sasha/claudecodeui
npm run dev
# Uses SQLite locally, no Docker needed
Step 8: Visual Distinction
Add this to your terminal profile (~/.zshrc or ~/.bash_profile):
# Docker project helper
dproject() {
echo "=== Active Docker Projects ==="
docker ps --format "table {{.Names}}" | awk -F'-' '{print $1}' | sort -u | grep -v NAMES
}
# Quick Sasha commands
alias sasha-up="cd ~/Documents/lambda1.nosync/sasha/claudecodeui && docker-compose up -d"
alias sasha-down="cd ~/Documents/lambda1.nosync/sasha/claudecodeui && docker-compose down"
alias sasha-logs="cd ~/Documents/lambda1.nosync/sasha/claudecodeui && docker-compose logs -f"
alias sasha-status="~/Documents/lambda1.nosync/sasha/scripts/docker-status.sh"
Recommended Action Plan
First: Clean up all old containers
docker container prune -fSecond: Decide on Sasha setup:
- For simplicity: Just use
npm run dev(no Docker) - For production-like: Use Docker Compose
- For simplicity: Just use
Third: Document your choice in README:
## Running Sasha Locally We use [Docker/No Docker] for local development. To start:Fourth: Create startup script at
sasha/start.sh:#!/bin/bash echo "π Starting Sasha..." cd /Users/lindsaysmith/Documents/lambda1.nosync/sasha/claudecodeui npm run dev echo "β Sasha is running at http://localhost:3001"
This will give you a clean, organized Docker environment where you always know what's running!