#!/bin/bash # MagicDoc API Service Startup Script echo "Starting MagicDoc API Service..." # Check if Docker is running if ! docker info > /dev/null 2>&1; then echo "Error: Docker is not running. Please start Docker first." exit 1 fi # Build and start the service echo "Building and starting MagicDoc API service..." docker-compose up --build -d # Wait for service to be ready echo "Waiting for service to be ready..." sleep 10 # Check health echo "Checking service health..." if curl -f http://localhost:8002/health > /dev/null 2>&1; then echo "✅ MagicDoc API service is running successfully!" echo "🌐 Service URL: http://localhost:8002" echo "📖 API Documentation: http://localhost:8002/docs" echo "🔍 Health Check: http://localhost:8002/health" else echo "❌ Service health check failed. Check logs with: docker-compose logs" fi echo "" echo "To stop the service, run: docker-compose down" echo "To view logs, run: docker-compose logs -f"