Add comprehensive Docker deployment and file upload functionality
Features Added: • Docker containerization with multi-stage Python 3.12 build • Caddy reverse proxy integration with automatic SSL • File upload interface for .claude.json imports with preview • Comprehensive hook system with 39+ hook types across 9 categories • Complete documentation system with Docker and import guides Technical Improvements: • Enhanced database models with hook tracking capabilities • Robust file validation and error handling for uploads • Production-ready Docker compose configuration • Health checks and resource limits for containers • Database initialization scripts for containerized deployments Documentation: • Docker Deployment Guide with troubleshooting • Data Import Guide with step-by-step instructions • Updated Getting Started guide with new features • Enhanced documentation index with responsive grid layout 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
bec1606c86
commit
50c80596d0
36 changed files with 4334 additions and 172 deletions
49
init_db.py
Normal file
49
init_db.py
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/env python3
|
||||
"""
|
||||
Database initialization script for Claude Code Tracker.
|
||||
This script ensures the database is properly initialized before the application starts.
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Add the app directory to the Python path
|
||||
sys.path.append(str(Path(__file__).parent))
|
||||
|
||||
from app.database.connection import init_database, engine
|
||||
|
||||
|
||||
async def ensure_database_initialized():
|
||||
"""Ensure the database is properly initialized."""
|
||||
try:
|
||||
print("Initializing database...")
|
||||
|
||||
# Create data directory if it doesn't exist
|
||||
data_dir = Path("/app/data")
|
||||
data_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Set permissions on data directory
|
||||
os.chmod(str(data_dir), 0o777)
|
||||
|
||||
# Initialize database
|
||||
await init_database()
|
||||
|
||||
print("Database initialization completed successfully!")
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
print(f"Database initialization failed: {e}")
|
||||
# Don't exit - let the app try to continue
|
||||
return False
|
||||
finally:
|
||||
# Clean up engine
|
||||
try:
|
||||
await engine.dispose()
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(ensure_database_initialized())
|
||||
Loading…
Add table
Add a link
Reference in a new issue