Files
discord-fishbowl/docker-start.sh
root 3d9e8ffbf0 Fix Docker startup script and complete application deployment
- Update docker-start.sh to force correct profiles (qdrant, admin)
- Fix PostgreSQL port mapping from 5432 to 15432 across all configs
- Resolve MCP import conflicts by renaming src/mcp to src/mcp_servers
- Fix admin interface StaticFiles mount syntax error
- Update LLM client to support both Ollama and OpenAI-compatible APIs
- Configure host networking for Discord bot container access
- Correct database connection handling for async context managers
- Update environment variables and Docker compose configurations
- Add missing production dependencies and Dockerfile improvements
2025-07-05 15:09:29 -07:00

110 lines
3.5 KiB
Bash
Executable File

#!/bin/bash
# Discord Fishbowl - Complete Docker Stack Startup
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${GREEN}🐠 Discord Fishbowl - Starting Complete Stack${NC}"
echo ""
# Check if Docker is running
if ! docker info >/dev/null 2>&1; then
echo -e "${RED}❌ Docker is not running. Please start Docker first.${NC}"
exit 1
fi
# Check if .env.docker exists
if [ ! -f .env.docker ]; then
echo -e "${YELLOW}⚠️ .env.docker not found. Using default environment.${NC}"
echo -e "${YELLOW} Make sure to configure your Discord tokens and LLM settings.${NC}"
fi
echo "Building and starting services..."
echo ""
# Determine which services to start
PROFILES=""
if [ -f .env.docker ]; then
# Check if .env.docker specifies vector database type
if grep -q "VECTOR_DB_TYPE=chromadb" .env.docker; then
PROFILES="$PROFILES --profile chromadb"
elif grep -q "VECTOR_DB_TYPE=qdrant" .env.docker; then
PROFILES="$PROFILES --profile qdrant"
fi
# Check if admin interface should be included
if grep -q "INCLUDE_ADMIN=true" .env.docker || grep -q "ADMIN_PORT=" .env.docker; then
PROFILES="$PROFILES --profile admin"
fi
fi
# Force required profiles based on working configuration
if [ -f .env.docker ]; then
# We know qdrant and admin are configured and working
PROFILES="--profile qdrant --profile admin"
fi
# Start the stack with appropriate profiles
docker compose --env-file .env.docker $PROFILES up -d --build
echo ""
echo -e "${GREEN}✅ Discord Fishbowl stack started successfully!${NC}"
echo ""
echo "Services available at:"
echo " 🤖 Discord Fishbowl App: Running in container"
# Get admin port from environment
ADMIN_PORT=${ADMIN_PORT:-8000}
if [ -f .env.docker ]; then
# Try to get admin port from .env.docker
if grep -q "ADMIN_PORT=" .env.docker; then
ADMIN_PORT=$(grep "ADMIN_PORT=" .env.docker | cut -d'=' -f2)
fi
fi
# Get server IP for external access
SERVER_IP=$(ip route get 1.1.1.1 | grep -oP 'src \K\S+' | head -1 2>/dev/null || echo "localhost")
# Check if admin profile is being used
if echo "$PROFILES" | grep -q "admin"; then
echo " 🌐 Admin Interface:"
echo " Local: http://localhost:$ADMIN_PORT"
echo " Network: http://$SERVER_IP:$ADMIN_PORT"
echo " Credentials: admin / FIre!@34"
else
echo " 🌐 Admin Interface: Not enabled (use --profile admin)"
fi
echo " 📊 PostgreSQL: localhost:15432"
echo " 🔴 Redis: localhost:6379"
# Show the correct vector database
if echo "$PROFILES" | grep -q "chromadb"; then
echo " 🧠 ChromaDB: http://localhost:8001"
elif echo "$PROFILES" | grep -q "qdrant"; then
echo " 🔍 Qdrant: http://localhost:6333"
echo " Dashboard: http://localhost:6333/dashboard"
else
# Check if vector database is configured in .env files
if [ -f .env.docker ] && (grep -q "VECTOR_DB_TYPE=" .env.docker || grep -q "QDRANT_" .env.docker); then
echo " 📝 Vector database configured but not in Docker profiles"
else
echo " 📝 No vector database configured"
fi
fi
echo ""
echo "To view logs:"
echo " docker compose logs -f fishbowl # Main application"
echo " docker compose logs -f fishbowl-admin # Admin interface"
echo " docker compose logs -f # All services"
echo ""
echo "To stop:"
echo " docker compose down"
echo ""
echo -e "${YELLOW}📝 Don't forget to configure your Discord tokens in .env.docker!${NC}"