Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

Add Docker deployment support for Observability dashboard

Open djacobsmeyer opened this issue 1 month ago • 0 comments

Summary

Adds Docker Compose deployment option for the Observability dashboard with improved reliability, health monitoring, and process lifecycle management.

Motivation

The current shell script deployment uses background Bun processes which can:

  • Become orphaned and difficult to track
  • Lack health monitoring and auto-restart capabilities
  • Have inconsistent logging (redirected to /dev/null)
  • Require manual process management

Docker provides:

  • ✅ Automatic process lifecycle management
  • ✅ Health checks with auto-restart on failure
  • ✅ Structured logging (no more /dev/null)
  • ✅ Clean isolation and resource management
  • ✅ No orphaned processes
  • ✅ Consistent environment across machines

Changes

New Files

  • docker-compose.yml - Service orchestration with health checks
  • apps/server/Dockerfile - Server container (Bun runtime)
  • apps/client/Dockerfile - Client container (multi-stage: Vite build → nginx serve)

Modified Files

  • manage.sh - Added docker-* subcommands (start, stop, restart, status, logs, build)
  • SKILL.md - Added Docker deployment documentation
  • apps/client/src/App.vue - Made WebSocket URL configurable via environment variable

Usage

# Start with Docker (recommended)
~/.claude/Skills/Observability/manage.sh docker-start

# View logs
~/.claude/Skills/Observability/manage.sh docker-logs

# Stop containers
~/.claude/Skills/Observability/manage.sh docker-stop

Shell script mode continues to work unchanged for backward compatibility.

Technical Details

Server Container:

  • Base: oven/bun:1-alpine
  • Health check: Polls /events/filter-options endpoint
  • Volume: Mounts ~/.claude directory (read-only) for event file access

Client Container:

  • Multi-stage build: Bun build → nginx serve
  • Nginx proxy for API and WebSocket endpoints
  • Health check: Polls root URL
  • Build-time environment variable for WebSocket configuration

Architecture:

  • Bridge network for inter-container communication
  • Dependency management (client waits for server healthy state)
  • Auto-restart on failure
  • 10-15 second startup grace periods

Testing

Tested on macOS with OrbStack:

  • ✅ Containers build successfully
  • ✅ Health checks pass and containers show "healthy" status
  • ✅ Server API accessible at http://localhost:4000
  • ✅ Client UI accessible at http://localhost:5172
  • ✅ WebSocket proxy routing through nginx
  • ✅ Volume mount correctly exposes event files
  • ✅ Backward compatibility maintained (shell script mode still works)

Backward Compatibility

This is an additive change:

  • Existing shell script deployment (manage.sh start/stop/restart/status) continues to work unchanged
  • Docker deployment is opt-in via new docker-* subcommands
  • No breaking changes to existing workflows

🤖 Generated with Claude Code

djacobsmeyer avatar Dec 28 '25 22:12 djacobsmeyer