File size: 2,018 Bytes
b30f068 | 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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | #!/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!"
|