Add comprehensive Docker setup with PostgreSQL, Redis, ChromaDB, and Qdrant
- Enhanced install.py with Docker detection and automatic service setup - Added docker-compose.services.yml for standalone database services - Created docker-services.sh management script for easy service control - Added DOCKER.md documentation with complete setup instructions - Updated requirements.txt for Python 3.13 compatibility - Added multiple test scripts and configuration files - Enhanced collaborative creative projects with proper database integration - Fixed SQLAlchemy metadata field conflicts in database models - Added comprehensive quickstart and testing guides Services now available: - PostgreSQL with Docker - Redis with Docker - ChromaDB vector database - Qdrant vector database (recommended) - PgAdmin for database administration The setup script now automatically detects Docker and offers streamlined installation with one-command service deployment.
This commit is contained in:
232
docker-services.sh
Executable file
232
docker-services.sh
Executable file
@@ -0,0 +1,232 @@
|
||||
#!/bin/bash
|
||||
# Discord Fishbowl Docker Services Management Script
|
||||
|
||||
set -e
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
COMPOSE_FILE="docker-compose.services.yml"
|
||||
ENV_FILE=".env.docker"
|
||||
|
||||
print_usage() {
|
||||
echo "Discord Fishbowl Docker Services Manager"
|
||||
echo ""
|
||||
echo "Usage: $0 {start|stop|restart|status|logs|admin|chromadb|qdrant|clean}"
|
||||
echo ""
|
||||
echo "Commands:"
|
||||
echo " start - Start PostgreSQL and Redis services"
|
||||
echo " stop - Stop all services"
|
||||
echo " restart - Restart all services"
|
||||
echo " status - Show service status"
|
||||
echo " logs - Show service logs"
|
||||
echo " admin - Start with PgAdmin (database admin interface)"
|
||||
echo " chromadb - Start with ChromaDB vector database"
|
||||
echo " qdrant - Start with Qdrant vector database"
|
||||
echo " clean - Stop services and remove volumes (WARNING: deletes data)"
|
||||
echo ""
|
||||
}
|
||||
|
||||
check_requirements() {
|
||||
if ! command -v docker &> /dev/null; then
|
||||
echo -e "${RED}Error: Docker is not installed${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! docker compose version &> /dev/null; then
|
||||
echo -e "${RED}Error: Docker Compose is not available${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$COMPOSE_FILE" ]; then
|
||||
echo -e "${RED}Error: $COMPOSE_FILE not found${NC}"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
start_services() {
|
||||
echo -e "${GREEN}🐠 Starting Discord Fishbowl services...${NC}"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo -e "${YELLOW}Creating default environment file...${NC}"
|
||||
cat > "$ENV_FILE" << EOF
|
||||
# Default Docker environment
|
||||
DB_PASSWORD=fishbowl_password
|
||||
REDIS_PASSWORD=redis_password
|
||||
PGADMIN_PASSWORD=admin123
|
||||
EOF
|
||||
fi
|
||||
|
||||
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" up -d
|
||||
|
||||
echo -e "${GREEN}✅ Services started successfully!${NC}"
|
||||
echo ""
|
||||
echo "Services available at:"
|
||||
echo " 📊 PostgreSQL: localhost:5432"
|
||||
echo " 🔴 Redis: localhost:6379"
|
||||
echo ""
|
||||
echo "Run '$0 status' to check service health"
|
||||
echo "Use '$0 chromadb' or '$0 qdrant' to add vector database"
|
||||
}
|
||||
|
||||
start_with_admin() {
|
||||
echo -e "${GREEN}🐠 Starting Discord Fishbowl services with PgAdmin...${NC}"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo -e "${YELLOW}Creating default environment file...${NC}"
|
||||
cat > "$ENV_FILE" << EOF
|
||||
# Default Docker environment
|
||||
DB_PASSWORD=fishbowl_password
|
||||
REDIS_PASSWORD=redis_password
|
||||
PGADMIN_PASSWORD=admin123
|
||||
EOF
|
||||
fi
|
||||
|
||||
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" --profile admin up -d
|
||||
|
||||
echo -e "${GREEN}✅ Services started successfully!${NC}"
|
||||
echo ""
|
||||
echo "Services available at:"
|
||||
echo " 📊 PostgreSQL: localhost:5432"
|
||||
echo " 🔴 Redis: localhost:6379"
|
||||
echo " 🧠 ChromaDB: http://localhost:8000"
|
||||
echo " 🌐 PgAdmin: http://localhost:8080"
|
||||
echo " Login: admin@fishbowl.dev / admin123"
|
||||
echo ""
|
||||
}
|
||||
|
||||
start_with_chromadb() {
|
||||
echo -e "${GREEN}🐠 Starting Discord Fishbowl services with ChromaDB...${NC}"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo -e "${YELLOW}Creating default environment file...${NC}"
|
||||
cat > "$ENV_FILE" << EOF
|
||||
# Default Docker environment
|
||||
DB_PASSWORD=fishbowl_password
|
||||
REDIS_PASSWORD=redis_password
|
||||
PGADMIN_PASSWORD=admin123
|
||||
EOF
|
||||
fi
|
||||
|
||||
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" --profile chromadb up -d
|
||||
|
||||
echo -e "${GREEN}✅ Services started successfully!${NC}"
|
||||
echo ""
|
||||
echo "Services available at:"
|
||||
echo " 📊 PostgreSQL: localhost:5432"
|
||||
echo " 🔴 Redis: localhost:6379"
|
||||
echo " 🧠 ChromaDB: http://localhost:8000"
|
||||
echo ""
|
||||
}
|
||||
|
||||
start_with_qdrant() {
|
||||
echo -e "${GREEN}🐠 Starting Discord Fishbowl services with Qdrant...${NC}"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo -e "${YELLOW}Creating default environment file...${NC}"
|
||||
cat > "$ENV_FILE" << EOF
|
||||
# Default Docker environment
|
||||
DB_PASSWORD=fishbowl_password
|
||||
REDIS_PASSWORD=redis_password
|
||||
PGADMIN_PASSWORD=admin123
|
||||
EOF
|
||||
fi
|
||||
|
||||
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" --profile qdrant up -d
|
||||
|
||||
echo -e "${GREEN}✅ Services started successfully!${NC}"
|
||||
echo ""
|
||||
echo "Services available at:"
|
||||
echo " 📊 PostgreSQL: localhost:5432"
|
||||
echo " 🔴 Redis: localhost:6379"
|
||||
echo " 🔍 Qdrant: http://localhost:6333"
|
||||
echo " Dashboard: http://localhost:6333/dashboard"
|
||||
echo ""
|
||||
}
|
||||
|
||||
stop_services() {
|
||||
echo -e "${YELLOW}🛑 Stopping Discord Fishbowl services...${NC}"
|
||||
docker compose -f "$COMPOSE_FILE" down
|
||||
echo -e "${GREEN}✅ Services stopped${NC}"
|
||||
}
|
||||
|
||||
restart_services() {
|
||||
stop_services
|
||||
sleep 2
|
||||
start_services
|
||||
}
|
||||
|
||||
show_status() {
|
||||
echo -e "${GREEN}📊 Discord Fishbowl Service Status${NC}"
|
||||
echo ""
|
||||
docker compose -f "$COMPOSE_FILE" ps
|
||||
echo ""
|
||||
|
||||
# Check health
|
||||
echo "Health checks:"
|
||||
for service in postgres redis chromadb; do
|
||||
if docker compose -f "$COMPOSE_FILE" ps --services --filter "status=running" | grep -q "$service"; then
|
||||
echo -e " ${GREEN}✅ $service: Running${NC}"
|
||||
else
|
||||
echo -e " ${RED}❌ $service: Not running${NC}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
show_logs() {
|
||||
echo -e "${GREEN}📋 Service Logs${NC}"
|
||||
docker compose -f "$COMPOSE_FILE" logs -f
|
||||
}
|
||||
|
||||
clean_services() {
|
||||
echo -e "${RED}⚠️ WARNING: This will delete all data in PostgreSQL, Redis, and ChromaDB!${NC}"
|
||||
read -p "Are you sure? Type 'yes' to continue: " confirm
|
||||
|
||||
if [ "$confirm" = "yes" ]; then
|
||||
echo -e "${YELLOW}🧹 Cleaning up services and data...${NC}"
|
||||
docker compose -f "$COMPOSE_FILE" down -v
|
||||
echo -e "${GREEN}✅ Cleanup complete${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}Cleanup cancelled${NC}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Main script
|
||||
check_requirements
|
||||
|
||||
case "${1:-}" in
|
||||
start)
|
||||
start_services
|
||||
;;
|
||||
stop)
|
||||
stop_services
|
||||
;;
|
||||
restart)
|
||||
restart_services
|
||||
;;
|
||||
status)
|
||||
show_status
|
||||
;;
|
||||
logs)
|
||||
show_logs
|
||||
;;
|
||||
admin)
|
||||
start_with_admin
|
||||
;;
|
||||
chromadb)
|
||||
start_with_chromadb
|
||||
;;
|
||||
qdrant)
|
||||
start_with_qdrant
|
||||
;;
|
||||
clean)
|
||||
clean_services
|
||||
;;
|
||||
*)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user