File size: 1,779 Bytes
31a2688
 
 
 
 
 
 
 
3f19c23
 
 
 
 
31a2688
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2408f3f
 
 
31a2688
 
 
 
 
 
 
 
3f19c23
 
31a2688
 
3f19c23
 
 
 
 
 
31a2688
 
2408f3f
 
 
31a2688
 
 
 
 
 
 
3f19c23
 
31a2688
 
 
 
 
 
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
services:
  qdrant:
    image: qdrant/qdrant:latest
    ports:
      - "6333:6333"
      - "6334:6334"
    volumes:
      - qdrant_data:/qdrant/storage
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:6333/healthz"]
      interval: 10s
      timeout: 3s
      retries: 5

  ollama:
    image: ollama/ollama:latest
    ports:
      - "11434:11434"
    volumes:
      - ollama_data:/root/.ollama
    profiles:
      - local

  ollama-init:
    image: ollama/ollama:latest
    depends_on:
      - ollama
    entrypoint: >
      sh -c "
        until ollama list --host http://ollama:11434 > /dev/null 2>&1; do
          echo 'Waiting for Ollama to be ready...';
          sleep 2;
        done;
        echo 'Pulling gemma3:4b...';
        ollama pull gemma3:4b --host http://ollama:11434;
        echo 'Model ready.';
      "
    profiles:
      - local

  api:
    build:
      context: .
      dockerfile: Dockerfile.compose
    ports:
      - "8000:8000"
    env_file:
      - .env
    environment:
      - QDRANT_URL=http://qdrant:6333
      - OLLAMA_BASE_URL=http://ollama:11434
    depends_on:
      qdrant:
        condition: service_healthy
    volumes:
      - ./docs:/app/docs
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/health/ready"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 60s

  ui:
    build:
      context: .
      dockerfile: Dockerfile.compose
    ports:
      - "8501:8501"
    env_file:
      - .env
    environment:
      - API_BASE_URL=http://api:8000
    depends_on:
      api:
        condition: service_healthy
    entrypoint: []
    command: ["streamlit", "run", "src/ui/app.py", "--server.port=8501", "--server.address=0.0.0.0"]

volumes:
  qdrant_data:
  ollama_data: