Repository navigation
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
88 lines (81 loc) · 2.03 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
88 lines (81 loc) · 2.03 KB
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
84
85
86
87
88
name: rag-intermediate
services:
ollama:
image: ollama/ollama:0.32.1
container_name: ollama
ports:
- "11434:11434"
volumes:
- ollama-data:/root/.ollama
environment:
- OLLAMA_HOST=0.0.0.0
healthcheck:
test: ["CMD", "ollama", "list"]
interval: 10s
timeout: 5s
retries: 5
# Uncomment the block below to enable GPU on Linux with Nvidia hardware.
# This requires installing the NVIDIA Container Toolkit.
# Note: Docker on Apple Silicon cannot access the GPU.
#
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: all
# capabilities: [gpu]
ollama-init:
image: ollama/ollama:0.32.1
container_name: ollama-init
volumes:
- ollama-data:/root/.ollama
environment:
- OLLAMA_HOST=http://ollama:11434
entrypoint: ["/bin/sh", "-c", "ollama pull llama3.2 && ollama pull nomic-embed-text"]
depends_on:
ollama:
condition: service_healthy
litellm:
image: ghcr.io/berriai/litellm:v1.92.0
container_name: litellm
ports:
- "4000:4000"
volumes:
- ./litellm/config.yaml:/app/config.yaml
command: ["--config", "/app/config.yaml", "--port", "4000"]
environment:
- LITELLM_MASTER_KEY=sk-local
depends_on:
- ollama
db:
image: pgvector/pgvector:pg17
container_name: pgvector
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: rag-intermediate
ports:
- "5432:5432"
volumes:
- ./pgvector/init-scripts:/docker-entrypoint-initdb.d
# Uncomment if persistence between runs is desired
#- pgdata:/var/lib/postgresql/data
rag:
build:
context: ./
dockerfile: Dockerfile
container_name: rag
environment:
- WATCH_DIRECTORY=/app/docs
ports:
- "8000:8000"
volumes:
- ./docs:/app/docs
networks:
ai-net:
driver: bridge
volumes:
ollama-data:
anythingllm-data: