Skip to content

Latest commit

Β 

History

History
142 lines (105 loc) Β· 3.1 KB

File metadata and controls

142 lines (105 loc) Β· 3.1 KB

πŸš€ Cosdata Setup Guide (Docker)

This guide will help you set up Cosdata using Docker for the Smart FAQ Assistant.

βœ… Prerequisites

  • Docker Desktop installed and running
  • Windows PowerShell

πŸ“¦ Step 1: Pull Cosdata Docker Image

docker pull cosdataio/cosdata:latest

πŸš€ Step 2: Run Cosdata Server

docker run -d `
  --name cosdata-server `
  -p 8443:8443 `
  -p 50051:50051 `
  cosdataio/cosdata:latest

Explanation:

  • -d - Run in detached mode (background)
  • --name cosdata-server - Name the container
  • -p 8443:8443 - Expose HTTP API port
  • -p 50051:50051 - Expose gRPC port

βœ… Step 3: Verify Cosdata is Running

# Check if container is running
docker ps

# Check logs
docker logs cosdata-server

# Verify API is reachable
# NOTE: This Cosdata image may not expose /health (it can return 404).
# Instead, test auth and then hit an authenticated endpoint.

# 1) Create a session (local docker often initializes with an empty admin key)
curl -sS -X POST http://localhost:8443/auth/create-session \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":""}'

# 2) Use the returned access_token to list collections
curl -sS http://localhost:8443/vectordb/collections \
  -H "Authorization: Bearer <PASTE_ACCESS_TOKEN_HERE>"

You should see a JSON response containing an access_token, then a JSON list of collections.

πŸ›‘ Managing the Container

Stop Cosdata:

docker stop cosdata-server

Start Cosdata:

docker start cosdata-server

View Logs:

docker logs -f cosdata-server

Remove Container:

docker rm -f cosdata-server

πŸ”„ Restart with Persistent Data (Optional)

To keep your data between container restarts:

# Create a volume
docker volume create cosdata-data

# Run with volume mount
docker run -d `
  --name cosdata-server `
  -p 8443:8443 `
  -p 50051:50051 `
  -v cosdata-data:/root/.cosdata `
  cosdataio/cosdata:latest

πŸ”§ Configuration

The backend is configured to connect to:

  • Host: http://localhost:8443
  • Username: admin (override with COSDATA_USERNAME)
  • Password/Admin key: empty by default for local Docker (override with COSDATA_PASSWORD)

Check backend/.env if you need to modify these settings.

πŸ› Troubleshooting

Port Already in Use?

# Use different ports
docker run -d `
  --name cosdata-server `
  -p 9443:8443 `
  -p 60051:50051 `
  cosdataio/cosdata:latest

# Update backend/.env
# COSDATA_API_URL=http://localhost:9443

Container Won't Start?

# Check logs
docker logs cosdata-server

# Ensure Docker is running
docker info

βœ… Next Steps

Once Cosdata is running:

  1. Start the backend: cd backend && npm run dev
  2. Start the frontend: cd frontend && npm run dev
  3. Open http://localhost:5173
  4. Load sample FAQs and test semantic search!

πŸ“š Additional Resources