-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
242 lines (231 loc) · 8.36 KB
/
Copy pathdocker-compose.yml
File metadata and controls
242 lines (231 loc) · 8.36 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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
##
## Kamerplanter – Docker Compose (local build)
##
## Quick start:
## cp .env.example .env # copy & edit passwords
## docker-compose up -d
##
## Optional profiles (not started by default):
## docker-compose --profile vectordb up -d # PostgreSQL + pgvector for AI/RAG
## docker-compose --profile ollama up -d # Local LLM inference (Ollama)
## docker-compose --profile timescaledb up -d # Time-series DB for sensor data
##
## Multiple profiles can be combined:
## docker-compose --profile vectordb --profile ollama up -d
##
## All credentials are read from .env (not hardcoded here).
## See .env.example for required variables.
##
version: "3.8"
services:
# ── ArangoDB ──────────────────────────────────────────────
arangodb:
image: arangodb:3.12@sha256:bf5eabc0fb3a16a13d0d4de00cddfbf2209e3d25630e5331832efb206519ff8f
environment:
ARANGO_ROOT_PASSWORD: ${ARANGO_ROOT_PASSWORD}
ports:
- "8529:8529"
volumes:
- arangodb_data:/var/lib/arangodb3
healthcheck:
test: ["CMD", "arangosh", "--server.password", "${ARANGO_ROOT_PASSWORD}", "--javascript.execute-string", "db._version()"]
interval: 10s
timeout: 5s
retries: 5
# ── Valkey (Redis-compatible) ────────────────────────────
valkey:
image: valkey/valkey:9-alpine@sha256:c9b77919daeba2c02ad954d0c844cc4e7142069d177b89c5fd771f405daf9e02
ports:
- "6379:6379"
volumes:
- valkey_data:/data
healthcheck:
test: ["CMD", "valkey-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# ── VectorDB (optional — PostgreSQL + pgvector for AI/RAG) ──
vectordb:
build:
context: ./docker/vectordb
profiles: ["vectordb"]
environment:
POSTGRES_DB: ${VECTORDB_DATABASE:-kamerplanter_vectors}
POSTGRES_USER: ${VECTORDB_USERNAME:-postgres}
POSTGRES_PASSWORD: ${VECTORDB_PASSWORD:-changeme}
ports:
- "5433:5432"
volumes:
- vectordb_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${VECTORDB_USERNAME:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
# ── Ollama (optional — local LLM inference for AI assistant) ──
ollama:
image: ollama/ollama:latest@sha256:6345fbc18bd73a1e16404be681dbc6fd291a027cab43ed541abe78c4c81051b0
profiles: ["ollama"]
environment:
OLLAMA_MODELS: /models
OLLAMA_HOST: "0.0.0.0:11434"
OLLAMA_NUM_PARALLEL: "1"
OLLAMA_MAX_LOADED_MODELS: "1"
ports:
- "11434:11434"
volumes:
- ollama_models:/models
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:11434/api/tags || exit 1"]
interval: 30s
timeout: 5s
retries: 5
# ── TimescaleDB (optional) ─────────────────────────────────
timescaledb:
image: timescale/timescaledb:2.28.3-pg16@sha256:61f891691050da6032023c01ea885730eeeba06b7c17b403e7d0b9c49c37dfe9
profiles: ["timescaledb"]
environment:
POSTGRES_DB: ${TIMESCALEDB_DATABASE:-kamerplanter_sensors}
POSTGRES_USER: ${TIMESCALEDB_USERNAME:-postgres}
POSTGRES_PASSWORD: ${TIMESCALEDB_PASSWORD:-changeme}
ports:
- "5432:5432"
volumes:
- timescaledb_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${TIMESCALEDB_USERNAME:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
# ── Reranker Service (optional — cross-encoder for RAG quality) ──
reranker-service:
build:
context: ./docker/reranker-service
dockerfile: Dockerfile
target: bge-reranker-v2-m3
profiles: ["vectordb"]
ports:
- "8081:8081"
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8081/health || exit 1"]
interval: 30s
timeout: 5s
retries: 10
# ── Backend (FastAPI) ─────────────────────────────────────
backend:
build:
context: ./src/backend
environment:
ARANGODB_HOST: arangodb
ARANGODB_PORT: "8529"
ARANGODB_DATABASE: ${ARANGODB_DATABASE}
ARANGODB_USERNAME: ${ARANGODB_USERNAME}
ARANGODB_PASSWORD: ${ARANGODB_PASSWORD}
REDIS_URL: ${REDIS_URL}
CORS_ORIGINS: '["http://localhost:3000","http://localhost:5173","http://localhost:8080"]'
DEBUG: ${DEBUG}
REQUIRE_EMAIL_VERIFICATION: ${REQUIRE_EMAIL_VERIFICATION}
KAMERPLANTER_MODE: light
TIMESCALEDB_ENABLED: ${TIMESCALEDB_ENABLED:-false}
TIMESCALEDB_HOST: timescaledb
TIMESCALEDB_PORT: "5432"
TIMESCALEDB_DATABASE: ${TIMESCALEDB_DATABASE:-kamerplanter_sensors}
TIMESCALEDB_USERNAME: ${TIMESCALEDB_USERNAME:-postgres}
TIMESCALEDB_PASSWORD: ${TIMESCALEDB_PASSWORD:-changeme}
VECTORDB_ENABLED: ${VECTORDB_ENABLED:-false}
VECTORDB_HOST: vectordb
VECTORDB_PORT: "5432"
VECTORDB_DATABASE: ${VECTORDB_DATABASE:-kamerplanter_vectors}
VECTORDB_USERNAME: ${VECTORDB_USERNAME:-postgres}
VECTORDB_PASSWORD: ${VECTORDB_PASSWORD:-changeme}
volumes:
- ./spec/knowledge/rag:/app/knowledge:ro
ports:
- "8000:8000"
depends_on:
- arangodb
- valkey
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8000/api/v1/health/live"]
interval: 10s
timeout: 5s
retries: 5
# ── Celery Worker ────────────────────────────────────────
celery-worker:
build:
context: ./src/backend
environment:
ARANGODB_HOST: arangodb
ARANGODB_PORT: "8529"
ARANGODB_DATABASE: ${ARANGODB_DATABASE}
ARANGODB_USERNAME: ${ARANGODB_USERNAME}
ARANGODB_PASSWORD: ${ARANGODB_PASSWORD}
REDIS_URL: ${REDIS_URL}
KAMERPLANTER_MODE: light
TIMESCALEDB_ENABLED: ${TIMESCALEDB_ENABLED:-false}
TIMESCALEDB_HOST: timescaledb
TIMESCALEDB_PORT: "5432"
TIMESCALEDB_DATABASE: ${TIMESCALEDB_DATABASE:-kamerplanter_sensors}
TIMESCALEDB_USERNAME: ${TIMESCALEDB_USERNAME:-postgres}
TIMESCALEDB_PASSWORD: ${TIMESCALEDB_PASSWORD:-changeme}
VECTORDB_ENABLED: ${VECTORDB_ENABLED:-false}
VECTORDB_HOST: vectordb
VECTORDB_PORT: "5432"
VECTORDB_DATABASE: ${VECTORDB_DATABASE:-kamerplanter_vectors}
VECTORDB_USERNAME: ${VECTORDB_USERNAME:-postgres}
VECTORDB_PASSWORD: ${VECTORDB_PASSWORD:-changeme}
volumes:
- ./spec/knowledge/rag:/app/knowledge:ro
depends_on:
- arangodb
- valkey
command: celery -A app.tasks worker --loglevel=info
# ── Celery Beat (periodic tasks) ─────────────────────────
celery-beat:
build:
context: ./src/backend
environment:
ARANGODB_HOST: arangodb
ARANGODB_PORT: "8529"
ARANGODB_DATABASE: ${ARANGODB_DATABASE}
ARANGODB_USERNAME: ${ARANGODB_USERNAME}
ARANGODB_PASSWORD: ${ARANGODB_PASSWORD}
REDIS_URL: ${REDIS_URL}
KAMERPLANTER_MODE: light
TIMESCALEDB_ENABLED: ${TIMESCALEDB_ENABLED:-false}
TIMESCALEDB_HOST: timescaledb
TIMESCALEDB_PORT: "5432"
TIMESCALEDB_DATABASE: ${TIMESCALEDB_DATABASE:-kamerplanter_sensors}
TIMESCALEDB_USERNAME: ${TIMESCALEDB_USERNAME:-postgres}
TIMESCALEDB_PASSWORD: ${TIMESCALEDB_PASSWORD:-changeme}
VECTORDB_ENABLED: ${VECTORDB_ENABLED:-false}
VECTORDB_HOST: vectordb
VECTORDB_PORT: "5432"
VECTORDB_DATABASE: ${VECTORDB_DATABASE:-kamerplanter_vectors}
VECTORDB_USERNAME: ${VECTORDB_USERNAME:-postgres}
VECTORDB_PASSWORD: ${VECTORDB_PASSWORD:-changeme}
depends_on:
- arangodb
- valkey
command: celery -A app.tasks beat --loglevel=info
# ── Frontend (React + nginx) ──────────────────────────────
frontend:
build:
context: ./src/frontend
environment:
KAMERPLANTER_MODE: light
ports:
- "8080:8080"
depends_on:
- backend
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8080/"]
interval: 10s
timeout: 5s
retries: 5
volumes:
arangodb_data:
valkey_data:
timescaledb_data:
vectordb_data:
ollama_models: