File size: 1,587 Bytes
d44b33d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Requires a project `.env` (copy from `.env.example`) for `env_file` and variable substitution.
name: docuaudit-ai

x-app: &app
  build: .
  image: docuaudit-ai:${IMAGE_TAG:-local}

services:
  api:
    <<: *app
    command: uvicorn api.main:app --host 0.0.0.0 --port 8000
    ports:
      - "${API_PORT:-8000}:8000"
    env_file:
      - .env
    environment:
      CHROMA_PERSIST_DIRECTORY: /data/chroma
      AUDIT_DB_PATH: /data/audit.db
      JOBS_DB_PATH: /data/jobs.db
      OLLAMA_BASE_URL: ${OLLAMA_BASE_URL:-http://host.docker.internal:11434}
    volumes:
      - docuaudit_data:/data
    extra_hosts:
      - "host.docker.internal:host-gateway"
    healthcheck:
      test:
        [
          "CMD",
          "python",
          "-c",
          "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=5)",
        ]
      interval: 15s
      timeout: 5s
      retries: 5
      start_period: 40s

  streamlit:
    <<: *app
    command: >
      streamlit run app.py
      --server.port=8501
      --server.address=0.0.0.0
      --server.headless=true
      --browser.gatherUsageStats=false
    ports:
      - "${STREAMLIT_PORT:-8501}:8501"
    env_file:
      - .env
    environment:
      DOC_AUDI_API_BASE: http://api:8000
      STREAMLIT_BACKEND_URL: http://api:8000
    depends_on:
      api:
        condition: service_healthy

  ollama:
    image: ollama/ollama:latest
    profiles: ["ollama"]
    ports:
      - "${OLLAMA_HOST_PORT:-11434}:11434"
    volumes:
      - ollama_data:/root/.ollama

volumes:
  docuaudit_data:
  ollama_data: