detectNanoBananaImage2 / test_local.sh
raghav
Comment out tensorboard_logger for inference-only deployment
6bb42a3
#!/bin/bash
# Quick test script for local Docker setup
# Usage: ./test_local.sh
set -e
echo "πŸ” Checking prerequisites..."
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "❌ Docker is not running. Please start Docker Desktop."
exit 1
fi
echo "βœ… Docker is running"
# Check if docker-compose is available
if ! command -v docker-compose &> /dev/null; then
echo "❌ docker-compose not found. Please install Docker Desktop."
exit 1
fi
echo "βœ… docker-compose is available"
echo ""
echo "πŸ—οΈ Building Docker image (this may take a few minutes)..."
docker-compose -f docker-compose.local.yml build
echo ""
echo "πŸš€ Starting container..."
docker-compose -f docker-compose.local.yml up -d
echo ""
echo "⏳ Waiting for app to start (30 seconds)..."
sleep 30
echo ""
echo "πŸ§ͺ Testing if app is accessible..."
if curl -s http://localhost:7860 > /dev/null; then
echo "βœ… App is accessible at http://localhost:7860"
echo ""
echo "πŸ“‹ Container logs:"
docker-compose -f docker-compose.local.yml logs --tail=20
echo ""
echo "πŸŽ‰ Success! Your app is running locally."
echo " Open http://localhost:7860 in your browser to test."
echo ""
echo "To stop the container, run:"
echo " docker-compose -f docker-compose.local.yml down"
else
echo "❌ App is not accessible. Checking logs..."
docker-compose -f docker-compose.local.yml logs
echo ""
echo "❌ Something went wrong. Check the logs above."
docker-compose -f docker-compose.local.yml down
exit 1
fi