File size: 1,527 Bytes
6dc9d46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
58
59
60
61
62
63
64
version: '3.8'

services:
  ragbot-api:
    build:
      context: ..
      dockerfile: api/Dockerfile
    container_name: ragbot-api
    ports:
      - "8000:8000"
    environment:
      # Ollama connection (host.docker.internal works on Docker Desktop)
      - OLLAMA_BASE_URL=http://host.docker.internal:11434
      
      # API configuration
      - API_HOST=0.0.0.0
      - API_PORT=8000
      - API_RELOAD=false
      
      # Logging
      - LOG_LEVEL=INFO
      
      # CORS
      - CORS_ORIGINS=*
    
    volumes:
      # Mount RagBot source (read-only) for development
      - ../src:/app/ragbot/src:ro
      - ../config:/app/ragbot/config:ro
      - ../data:/app/ragbot/data:ro
      
      # Mount API code for hot reload (development only)
      # Comment out for production
      - ./app:/app/api/app
    
    # Use host network to access localhost Ollama
    # Alternative: network_mode: "host"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    
    restart: unless-stopped
    
    healthcheck:
      test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:8000/api/v1/health')"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s
    
    # Resource limits (adjust based on your system)
    deploy:
      resources:
        limits:
          cpus: '2.0'
          memory: 4G
        reservations:
          cpus: '1.0'
          memory: 2G

# Optional: Add network definition for future services
networks:
  default:
    name: ragbot-network