-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
92 lines (87 loc) · 2.23 KB
/
docker-compose.yml
File metadata and controls
92 lines (87 loc) · 2.23 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
89
90
91
92
services:
# Ollama - LLM Server (lightweight model)
ollama:
image: ollama/ollama:latest
container_name: ollama
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
deploy:
resources:
limits:
memory: 3G # Limit memory for Ollama (tinyllama is ~600MB)
healthcheck:
test: ["CMD", "ollama", "list"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
restart: unless-stopped
# Model Puller - Downloads the lightweight model on startup
model-puller:
image: curlimages/curl:latest
container_name: model-puller
depends_on:
ollama:
condition: service_healthy
entrypoint: ["/bin/sh", "-c"]
command:
- |
echo "Waiting for Ollama to be ready..."
sleep 5
echo "Pulling tinyllama:1.1b model (ultra-lightweight, ~600MB)..."
curl -X POST http://ollama:11434/api/pull -d '{"name": "tinyllama:1.1b"}'
echo "Pulling nomic-embed-text for embeddings..."
curl -X POST http://ollama:11434/api/pull -d '{"name": "nomic-embed-text"}'
echo "Models downloaded successfully!"
# ChromaDB - Lightweight Vector Database
chromadb:
image: chromadb/chroma:latest
container_name: chromadb
ports:
- "8000:8000"
volumes:
- chroma_data:/chroma/chroma
environment:
- IS_PERSISTENT=TRUE
- ANONYMIZED_TELEMETRY=FALSE
deploy:
resources:
limits:
memory: 512M
restart: unless-stopped
# GenAI App - Streamlit RAG Application
genai-app:
build:
context: ./app
dockerfile: Dockerfile
container_name: genai-app
ports:
- "8501:8501"
environment:
- OLLAMA_BASE_URL=http://ollama:11434
- CHROMA_HOST=chromadb
- CHROMA_PORT=8000
- LLM_MODEL=tinyllama:1.1b
- EMBEDDING_MODEL=nomic-embed-text
depends_on:
ollama:
condition: service_healthy
chromadb:
condition: service_started
volumes:
- ./app:/app
- uploaded_docs:/app/uploads
deploy:
resources:
limits:
memory: 1G
restart: unless-stopped
volumes:
ollama_data:
chroma_data:
uploaded_docs:
networks:
default:
name: genai-network