File size: 1,805 Bytes
0452a50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# IntegraChat Docker Helper Commands for PowerShell

# Function to start/restart the container
function Start-IntegraChat {
    Write-Host "Starting IntegraChat container..." -ForegroundColor Green
    
    # Check if container exists
    $exists = docker ps -a --filter "name=integrachat" --format "{{.Names}}"
    
    if ($exists -eq "integrachat") {
        Write-Host "Container exists. Stopping and removing..." -ForegroundColor Yellow
        docker stop integrachat 2>$null
        docker rm integrachat 2>$null
    }
    
    # Run the container
    docker run -d --name integrachat `
        -p 7860:7860 `
        -p 8000:8000 `
        -p 8900:8900 `
        -e DOCKER_CONTAINER=1 `
        integrachat:latest
    
    if ($LASTEXITCODE -eq 0) {
        Write-Host "`n✅ Container started!" -ForegroundColor Green
        Write-Host "`nAccess services:" -ForegroundColor Cyan
        Write-Host "  • Gradio UI: http://localhost:7860"
        Write-Host "  • FastAPI:   http://localhost:8000"
        Write-Host "  • MCP Server: http://localhost:8900"
        Write-Host "`nView logs: docker logs -f integrachat" -ForegroundColor Yellow
    }
}

# Function to stop the container
function Stop-IntegraChat {
    Write-Host "Stopping IntegraChat container..." -ForegroundColor Yellow
    docker stop integrachat
}

# Function to view logs
function Show-IntegraChatLogs {
    docker logs -f integrachat
}

# Function to rebuild
function Rebuild-IntegraChat {
    Write-Host "Rebuilding IntegraChat..." -ForegroundColor Green
    docker stop integrachat 2>$null
    docker rm integrachat 2>$null
    docker build -t integrachat:latest .
    Start-IntegraChat
}

# Export functions
Export-ModuleMember -Function Start-IntegraChat, Stop-IntegraChat, Show-IntegraChatLogs, Rebuild-IntegraChat