-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
225 lines (209 loc) · 4.94 KB
/
docker-compose.dev.yml
File metadata and controls
225 lines (209 loc) · 4.94 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# Development Environment Overlay
# Usage: docker compose -f docker-compose.yml -f docker-compose.dev.yml --profile dev up -d
#
# This creates an isolated development environment with:
# - Different ports (3001, 8001, 5433) to avoid conflicts with production
# - Separate volumes (postgres_data_dev, ollama_models_dev, etc.)
# - Mounts ./archive_dev instead of ./archive_root
# - Can be fully reset without affecting production data
services:
db:
profiles:
- prod
db-dev:
image: pgvector/pgvector:pg16
profiles:
- dev
environment:
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
POSTGRES_DB: ${DB_NAME:-archive_brain_dev}
volumes:
- postgres_data_dev:/var/lib/postgresql/data
ports:
- "5433:5432"
networks:
- archive_net_dev
deploy:
resources:
limits:
cpus: '2'
memory: 4G
reservations:
cpus: '0.5'
memory: 512M
tika:
profiles:
- prod
tika-dev:
image: apache/tika:latest
profiles:
- dev
ports:
- "9999:9998"
networks:
- archive_net_dev
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 256M
ollama:
profiles:
- prod
ollama-dev:
image: ollama/ollama:latest
profiles:
- dev
ports:
- "11435:11434"
volumes:
- ollama_models_dev:/root/.ollama
networks:
- archive_net_dev
healthcheck:
test: ["CMD-SHELL", "ollama list || exit 1"]
interval: 30s
timeout: 30s
retries: 5
start_period: 60s
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
ollama-init:
profiles:
- prod
ollama-init-dev:
image: ollama/ollama:latest
profiles:
- dev
depends_on:
ollama-dev:
condition: service_healthy
networks:
- archive_net_dev
entrypoint: ["/bin/sh", "-c"]
command:
- |
echo "Pulling required models for dev environment..."
ollama pull nomic-embed-text
ollama pull qwen2:1.5b
echo "Dev models ready!"
environment:
- OLLAMA_HOST=ollama-dev:11434
restart: "no"
worker:
profiles:
- prod
worker-dev:
build: ./backend
profiles:
- dev
volumes:
- ./backend:/app
- ./config:/app/config
- ./archive_dev:/data/archive
- /mnt/oak/knowledge:/data/archive/knowledge
- worker_shared_dev:/app/shared
environment:
- DB_HOST=db-dev
- DB_PORT=5432
- DB_USER=${DB_USER:-postgres}
- DB_PASSWORD=${DB_PASSWORD:-password}
- DB_NAME=${DB_NAME:-archive_brain_dev}
- TIKA_URL=http://tika-dev:9998
- OLLAMA_URL=http://ollama-dev:11434
- OLLAMA_MOCK=${OLLAMA_MOCK:-false}
- OLLAMA_MODEL=${OLLAMA_MODEL:-qwen2:1.5b}
- OLLAMA_EMBEDDING_MODEL=${OLLAMA_EMBEDDING_MODEL:-nomic-embed-text}
depends_on:
ollama-dev:
condition: service_healthy
db-dev:
condition: service_started
tika-dev:
condition: service_started
command: python -m src.worker_loop
networks:
- archive_net_dev
deploy:
resources:
limits:
cpus: '4'
memory: 8G
reservations:
cpus: '1'
memory: 1G
api:
profiles:
- prod
api-dev:
build: ./backend
profiles:
- dev
ports:
- "8001:8000"
volumes:
- ./backend:/app
- ./config:/app/config
- ./archive_dev:/data/archive
- /mnt/oak/knowledge:/data/archive/knowledge
- worker_shared_dev:/app/shared
environment:
- DB_HOST=db-dev
- DB_PORT=5432
- DB_USER=${DB_USER:-postgres}
- DB_PASSWORD=${DB_PASSWORD:-password}
- DB_NAME=${DB_NAME:-archive_brain_dev}
- OLLAMA_URL=http://ollama-dev:11434
- OLLAMA_MOCK=${OLLAMA_MOCK:-false}
- OLLAMA_MODEL=${OLLAMA_MODEL:-qwen2:1.5b}
- OLLAMA_EMBEDDING_MODEL=${OLLAMA_EMBEDDING_MODEL:-nomic-embed-text}
depends_on:
ollama-dev:
condition: service_healthy
db-dev:
condition: service_started
command: uvicorn src.api.main:app --host 0.0.0.0 --port 8000 --reload
networks:
- archive_net_dev
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 256M
frontend:
profiles:
- prod
frontend-dev:
build: ./frontend
profiles:
- dev
ports:
- "3001:3000"
volumes:
- ./frontend:/app
- /app/node_modules
environment:
- VITE_API_TARGET=http://api-dev:8000
- VITE_HMR_PORT=3001
depends_on:
- api-dev
networks:
- archive_net_dev
volumes:
postgres_data_dev:
worker_shared_dev:
ollama_models_dev:
networks:
archive_net_dev: