#!/bin/bash # Qdrant Docker Setup Script echo "๐Ÿš€ Setting up Qdrant with Docker..." echo "" # Check if Qdrant container already exists if docker ps -a | grep -q qdrant; then echo "๐Ÿ“ฆ Qdrant container found" # Check if it's running if docker ps | grep -q qdrant; then echo "โœ… Qdrant is already running!" echo "" echo "๐Ÿ“ Qdrant Dashboard: http://localhost:6333/dashboard" echo "๐Ÿ“ Qdrant API: http://localhost:6333" else echo "โš ๏ธ Container exists but not running. Starting it..." docker start qdrant sleep 2 echo "โœ… Qdrant started!" echo "" echo "๐Ÿ“ Qdrant Dashboard: http://localhost:6333/dashboard" echo "๐Ÿ“ Qdrant API: http://localhost:6333" fi else echo "๐Ÿ“ฆ Creating new Qdrant container..." # Run Qdrant container docker run -d \ --name qdrant \ -p 6333:6333 \ -p 6334:6334 \ -v $(pwd)/qdrant_storage:/qdrant/storage \ qdrant/qdrant echo "" echo "โณ Waiting for Qdrant to start..." sleep 3 # Check if container is running if docker ps | grep -q qdrant; then echo "โœ… Qdrant is running!" echo "" echo "๐Ÿ“ Qdrant Dashboard: http://localhost:6333/dashboard" echo "๐Ÿ“ Qdrant API: http://localhost:6333" echo "" echo "๐Ÿ’พ Storage: ./qdrant_storage (persistent)" else echo "โŒ Failed to start Qdrant. Check Docker logs:" docker logs qdrant fi fi echo "" echo "๐Ÿงช Testing connection..." python3 -c " from qdrant_client import QdrantClient try: client = QdrantClient(host='localhost', port=6333) collections = client.get_collections().collections print(f'โœ… Connection successful!') print(f'๐Ÿ“ฆ Collections: {len(collections)}') for coll in collections: print(f' - {coll.name}') except Exception as e: print(f'โŒ Connection failed: {e}') " echo "" echo "โœ… Setup complete!"