File size: 1,138 Bytes
4e7b77b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash

echo "πŸ”§ Rebuilding and testing Legal Dashboard OCR Docker container..."

# Stop any running containers
echo "Stopping existing containers..."
docker-compose down 2>/dev/null || true
docker stop legal-dashboard-ocr 2>/dev/null || true

# Remove old images
echo "Removing old images..."
docker rmi legal-dashboard-ocr 2>/dev/null || true

# Create data and cache directories
echo "Creating data and cache directories..."
mkdir -p data cache
chmod -R 777 data cache

# Build the new image
echo "Building new Docker image..."
docker build -t legal-dashboard-ocr .

# Test the container
echo "Testing container..."
docker run --rm -v $(pwd)/data:/app/data -v $(pwd)/cache:/app/cache legal-dashboard-ocr python debug_container.py

# Start with docker-compose
echo "Starting with docker-compose..."
docker-compose up --build -d

# Wait a moment for startup
echo "Waiting for application to start..."
sleep 10

# Test health endpoint
echo "Testing health endpoint..."
curl -f http://localhost:7860/health || echo "Health check failed"

echo "βœ… Rebuild and test complete!"
echo "Access the application at: http://localhost:7860"