#!/bin/bash # Startup script for Superset in Codespaces echo "๐Ÿš€ Starting Superset in Codespaces..." echo "๐ŸŒ Frontend will be available at port 9001" # Check if MCP is enabled if [ "$ENABLE_MCP" = "true" ]; then echo "๐Ÿค– MCP Service will be available at port 5008" fi # Find the workspace directory (Codespaces clones as 'superset', not 'superset-2') WORKSPACE_DIR=$(find /workspaces -maxdepth 1 -name "superset*" -type d | head -1) if [ -n "$WORKSPACE_DIR" ]; then cd "$WORKSPACE_DIR" echo "๐Ÿ“ Working in: $WORKSPACE_DIR" else echo "๐Ÿ“ Using current directory: $(pwd)" fi # Check if docker is running if ! docker info > /dev/null 2>&1; then echo "โณ Waiting for Docker to start..." sleep 5 fi # Clean up any existing containers echo "๐Ÿงน Cleaning up existing containers..." docker-compose -f docker-compose-light.yml --profile mcp down # Start services echo "๐Ÿ—๏ธ Building and starting services..." echo "" echo "๐Ÿ“ Once started, login with:" echo " Username: admin" echo " Password: admin" echo "" echo "๐Ÿ“‹ Running in foreground with live logs (Ctrl+C to stop)..." # Run docker-compose and capture exit code if [ "$ENABLE_MCP" = "true" ]; then echo "๐Ÿค– Starting with MCP Service enabled..." docker-compose -f docker-compose-light.yml --profile mcp up else docker-compose -f docker-compose-light.yml up fi EXIT_CODE=$? # If it failed, provide helpful instructions if [ $EXIT_CODE -ne 0 ] && [ $EXIT_CODE -ne 130 ]; then # 130 is Ctrl+C echo "" echo "โŒ Superset startup failed (exit code: $EXIT_CODE)" echo "" echo "๐Ÿ”„ To restart Superset, run:" echo " .devcontainer/start-superset.sh" echo "" echo "๐Ÿ”ง For troubleshooting:" echo " # View logs:" echo " docker-compose -f docker-compose-light.yml logs" echo "" echo " # Clean restart (removes volumes):" echo " docker-compose -f docker-compose-light.yml down -v" echo " .devcontainer/start-superset.sh" echo "" echo " # Common issues:" echo " - Network timeouts: Just retry, often transient" echo " - Port conflicts: Check 'docker ps'" echo " - Database issues: Try clean restart with -v" fi