Skip to content

Latest commit

 

History

History
432 lines (324 loc) · 11.5 KB

File metadata and controls

432 lines (324 loc) · 11.5 KB

DataPilot Docker Deployment

Docker Deployment Production Ready Development Mode


REVOLUTIONARY AI PLATFORM - DOCKER DEPLOYMENT

Deploy DataPilot's revolutionary AI-powered Salesforce intelligence platform with enterprise-grade Docker containers.


Table of Contents


ARCHITECTURE

Container Architecture

graph TB
    subgraph "DataPilot Docker Stack"
        subgraph "Frontend Layer"
            D[Dashboard Container<br/>React + TypeScript<br/>Port: 3001]
        end
        
        subgraph "Backend Layer"
            B[Backend Container<br/>Python + FastAPI<br/>Port: 8001]
        end
        
        subgraph "Data Layer"
            M[MongoDB Container<br/>Database<br/>Port: 27918]
        end
        
        subgraph "Network Layer"
            N[DataPilot Network<br/>Internal Communication]
        end
    end
    
    D -->|API Calls| B
    B -->|Data Operations| M
    D -.->|Hot Reload| N
    B -.->|Auto Reload| N
    M -.->|Persistence| N
Loading

QUICK START

Prerequisites

  • Docker and Docker Compose installed
  • Git installed
  • Ports 3001, 8001, 27918 available

Port Conflicts? If ports are in use, you'll need to change them in the configuration files (see Port Configuration section).

1. Get the Configuration Files

You need docker/ from the repository either way (compose file, MongoDB init scripts, and the environment config templates) — but the two options below differ in whether you also build the app images yourself or use the ones already published to GHCR.

git clone https://github.com/bassem-elsodany/datapilot.git
cd datapilot/docker

# Make start script executable (build-from-source option only)
chmod +x start.sh

Option A — Pre-built images (fastest, no build step): Uses docker-compose.ghcr.yml, which pulls ghcr.io/bassem-elsodany/datapilot-backend and ghcr.io/bassem-elsodany/datapilot-dashboard (multi-arch: amd64 + arm64) directly instead of building locally.

docker compose -f docker-compose.ghcr.yml up -d

Option B — Build from source: Uses docker-compose.yml, which builds both images locally from the Dockerfile.backend / Dockerfile.dashboard in this directory. Use this if you're modifying the app itself.

docker compose up -d
# or: ./start.sh start (see step 3 below)

Either way, continue with steps 2-5 below — configuration and verification are identical.

2. Configure Environment

IMPORTANT: AI Agent features are OPTIONAL!

  • Without AI keys: All tabs work normally except the AI Assistant tab
  • With AI keys: Full AI-powered query assistance and reasoning
  • Other features: Schema Explorer, Query Editor, Saved Queries work perfectly without AI
# Edit backend configuration
nano environment-configs/backend.env

# OPTIONAL: AI Agent Configuration (skip if you don't want AI features)
LLM_PROVIDER=openai                    # openai, groq, ollama
LLM_MODEL_NAME=gpt-4o-mini            # gpt-4o, gpt-4o-mini, llama-3.3-70b-versatile, qwen3:30b
LLM_API_KEY=sk-your-openai-api-key-here
LLM_TEMPERATURE=0.7
LLM_MAX_TOKENS=15000

# REQUIRED: Adjust logging level
LOG_LEVEL=INFO
# Edit frontend configuration
nano environment-configs/dashboard.env

# OPTIONAL: VITE_API_BASE_URL is auto-detected at runtime (same host that
# served the page, port 8001) - only set it for a split-host deployment
# where the frontend and backend run on different hosts/domains:
# VITE_API_BASE_URL=http://your-backend-host:8001

3. Start DataPilot

If you used Option A (pre-built images):

docker compose -f docker-compose.ghcr.yml up -d      # start
docker compose -f docker-compose.ghcr.yml down       # stop
docker compose -f docker-compose.ghcr.yml pull       # fetch newer :latest images

If you used Option B (build from source):

# Production mode
./start.sh start

# Development mode (with hot reload)
./start.sh dev

# Stop application
./start.sh stop

# Reset all data and restart (DANGEROUS!)
./start.sh reset

4. Access Application

5. Verify Installation

# Check all services are running
./start.sh status

# Test backend health
curl http://localhost:8001/api/v1/health

# Check logs if needed
./start.sh logs

CONFIGURATION

PORT CONFIGURATION

If the default ports (3001, 8001, 27918) are already in use, you can change them:

Step 1: Update Docker Compose

# Edit docker-compose.yml
nano docker-compose.yml

# Change these lines:
ports:
  - "3002:80"     # Frontend: 3002 instead of 3001
  - "8002:8000"   # Backend: 8002 instead of 8001
  - "27019:27017" # MongoDB: 27019 instead of 27918

Step 2: Update Frontend Configuration

# Edit environment-configs/dashboard.env
nano environment-configs/dashboard.env

# Update API URL to match new backend port:
VITE_API_BASE_URL=http://localhost:8002

Step 3: Update Backend Configuration

# Edit environment-configs/backend.env
nano environment-configs/backend.env

# Update MongoDB connection:
MONGO_HOST=mongodb
MONGO_PORT=27017  # Keep internal port same

Step 4: Restart Services

# Stop and restart with new ports
./start.sh stop
./start.sh start

New Access URLs


AI MODEL CONFIGURATION

DataPilot supports multiple AI providers and advanced reasoning models:

Supported Providers

  • OpenAI: GPT-4o, GPT-4o-mini, GPT-4-turbo
  • Groq: Llama-3.3-70b-versatile, Mixtral-8x7b, Gemma-7b
  • Ollama: Local models (Llama, Qwen, Mistral, etc.)

Advanced Reasoning Models

# OpenAI Models
LLM_MODEL_NAME=gpt-4o                    # Most capable reasoning
LLM_MODEL_NAME=gpt-4o-mini              # Fast and efficient
LLM_MODEL_NAME=gpt-4-turbo              # Balanced performance

# Groq Models (Ultra-fast inference)
LLM_MODEL_NAME=llama-3.3-70b-versatile  # Advanced reasoning
LLM_MODEL_NAME=mixtral-8x7b-32768      # High performance
LLM_MODEL_NAME=gemma-7b-it              # Fast and capable

# Ollama Models (Local deployment)
LLM_MODEL_NAME=qwen3:30b                # Advanced Chinese/English
LLM_MODEL_NAME=llama3:70b               # Meta's latest
LLM_MODEL_NAME=mistral:7b              # Efficient reasoning

Model Configuration

# Temperature (0.0-1.0): Controls creativity vs consistency
LLM_TEMPERATURE=0.7                    # Balanced (recommended)
LLM_TEMPERATURE=0.3                    # More consistent
LLM_TEMPERATURE=0.9                    # More creative

# Max Tokens: Response length limit
LLM_MAX_TOKENS=15000                   # Long responses
LLM_MAX_TOKENS=4000                    # Shorter responses

# Timeout: Request timeout in seconds
LLM_TIMEOUT_SECONDS=60                 # Standard timeout
LLM_TIMEOUT_SECONDS=120                # For complex queries

CONFIGURATION

Backend Settings (environment-configs/backend.env)

# AI Configuration (OPTIONAL - skip if you don't want AI features)
LLM_PROVIDER=openai                    # openai, groq, ollama
LLM_MODEL_NAME=gpt-4o-mini            # gpt-4o, gpt-4o-mini, llama-3.3-70b-versatile, qwen3:30b
LLM_API_KEY=sk-your-api-key-here     # Your API key
LLM_TEMPERATURE=0.7                   # 0.0-1.0 (creativity level)
LLM_MAX_TOKENS=15000                  # Maximum response length

# For Ollama (local models):
# LLM_BASE_URL=http://localhost:11434/v1

# Server Settings (REQUIRED)
HOST=0.0.0.0
PORT=8000
LOG_LEVEL=INFO                        # DEBUG, INFO, WARNING, ERROR
DEBUG=false

Frontend Settings (environment-configs/dashboard.env)

# API Connection (REQUIRED)
VITE_API_BASE_URL=http://localhost:8001

# For different deployments:
# VITE_API_BASE_URL=http://your-server:8001
# VITE_API_BASE_URL=https://api.yourdomain.com

# Application Settings (OPTIONAL)
VITE_APP_NAME=DataPilot
VITE_DEFAULT_FONT_SIZE=medium
VITE_ENABLE_SEARCH=true

MANAGEMENT COMMANDS

# Start commands
./start.sh start          # Production mode
./start.sh dev            # Development mode with hot reload

# Management commands  
./start.sh stop           # Stop all services
./start.sh restart        # Restart services
./start.sh status         # Show service status
./start.sh logs           # View all logs
./start.sh logs backend   # View backend logs
./start.sh cleanup        # Clean up resources

TROUBLESHOOTING

Common Issues

"Permission Denied" Error

# Fix: Make start script executable
chmod +x start.sh

"Docker Not Found" Error

# Install Docker Desktop or Docker Engine
# macOS: https://docs.docker.com/desktop/mac/install/
# Linux: https://docs.docker.com/engine/install/
# Windows: https://docs.docker.com/desktop/windows/install/

"Port Already in Use" Error

# Check what's using the ports
lsof -i :3001
lsof -i :8001
lsof -i :27918

# Option 1: Stop conflicting services
sudo kill -9 $(lsof -ti:3001)
sudo kill -9 $(lsof -ti:8001)
sudo kill -9 $(lsof -ti:27918)

# Option 2: Change ports (see Port Configuration section above)
# Edit docker-compose.yml and env files with new ports

"Container Won't Start" Error

# Check Docker is running
docker info

# Check available disk space
df -h

# Check Docker logs
./start.sh logs

AI Not Working

# Check API key is set
docker-compose exec backend env | grep LLM_API_KEY

# Check backend logs
./start.sh logs backend

Frontend Can't Connect to Backend

# Check API URL setting
docker-compose exec dashboard env | grep VITE_API_BASE_URL

# Test backend connectivity
curl http://localhost:8001/api/v1/health

Container Issues

# View logs
./start.sh logs

# Restart services
./start.sh restart

# Rebuild containers
docker-compose down
docker-compose up --build -d

SERVICES

Service Port Technology Description
Frontend 3001 React + TypeScript User interface with hot reload
Backend 8001 Python + FastAPI AI API with auto-reload
Database 27918 MongoDB 7.0 Persistent data storage

LICENSE

This project is licensed under the MIT License - see the LICENSE file for details.


**DEPLOY THE REVOLUTIONARY AI PLATFORM **

Transform your Salesforce experience with containerized AI intelligence

Quick Start • Configuration • Troubleshooting