generated from akkadotnet/build-system-template
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
92 lines (85 loc) · 2.58 KB
/
docker-compose.dev.yml
File metadata and controls
92 lines (85 loc) · 2.58 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
# Docker Compose configuration for development dependencies only
# Use this when running the Memorizer application from your IDE
#
# Usage: docker-compose -f docker-compose.dev.yml up -d
#
# This starts:
# - PostgreSQL with pgvector extension (port 5432)
# - pgAdmin web UI (port 5050)
# - Ollama LLM service (port 11434)
# - Automatic model downloads for embeddings and LLM
services:
postgres:
image: pgvector/pgvector:pg17
restart: unless-stopped
container_name: memorizer-postgres-dev
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgmem
ports:
- "5432:5432"
volumes:
- postgres-data-dev:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
pgadmin:
image: dpage/pgadmin4
restart: unless-stopped
container_name: memorizer-pgadmin-dev
environment:
- PGADMIN_DEFAULT_EMAIL=admin@example.com
- PGADMIN_DEFAULT_PASSWORD=admin
ports:
- "5050:80"
depends_on:
- postgres
ollama:
image: ollama/ollama
restart: unless-stopped
container_name: memorizer-ollama-dev
ports:
- "11434:11434"
volumes:
- ollama-data-dev:/root/.ollama
# Initialize Ollama with the required models
ollama-init:
image: curlimages/curl:latest
container_name: memorizer-ollama-init-dev
entrypoint: ["/bin/sh", "-c"]
depends_on:
- ollama
command: >
"
echo 'Waiting for Ollama service to start...' &&
sleep 15 &&
echo 'Pulling embedding model...' &&
for i in 1 2 3 4 5; do
echo 'Attempting to pull embedding model (try $i/5)...' &&
if curl -s -X POST http://ollama:11434/api/pull -d '{\"name\": \"all-minilm:33m-l12-v2-fp16\"}'; then
echo 'Embedding model pull initiated successfully' &&
break
fi &&
echo 'Ollama not ready yet for embedding model, waiting...' &&
sleep 10
done &&
echo 'Pulling lightweight LLM model...' &&
for i in 1 2 3 4 5; do
echo 'Attempting to pull LLM model (try $i/5)...' &&
if curl -s -X POST http://ollama:11434/api/pull -d '{\"name\": \"qwen2:0.5b\"}'; then
echo 'LLM model pull initiated successfully' &&
echo 'All models pulled successfully' &&
exit 0
fi &&
echo 'Failed to pull LLM model, retrying...' &&
sleep 10
done &&
echo 'Failed to pull models after multiple attempts' &&
exit 1
"
volumes:
postgres-data-dev:
ollama-data-dev: