-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
524 lines (497 loc) · 12.6 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
524 lines (497 loc) · 12.6 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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# Local dev — all infra runs locally in containers.
# Images are served via local minio (not the in-cluster one which is unreachable from laptop).
# GitHub Actions publishes release images; local dev builds from source.
#
# Usage:
# docker compose up --build
# Stop: docker compose down
# Browse: http://localhost:8082/api/browse/boards/b
# Frontend: http://localhost:3000
services:
go-tests:
profiles:
- tools
build:
context: .
dockerfile: services/Dockerfile.golang
target: tests
environment:
S3_BUCKET: test
S3_ENDPOINT: storage.example.test
S3_USE_SSL: "true"
TEST_DATABASE_URL: postgres://lolcatz:lolcatz@postgres:5432/lolcatz?sslmode=disable
search-tests:
profiles:
- tools
build:
context: .
dockerfile: services/Dockerfile.search
target: tests
environment:
TEST_DATABASE_URL: postgres://lolcatz:lolcatz@postgres:5432/lolcatz?sslmode=disable
depends_on:
postgres:
condition: service_healthy
rust-tools:
image: rust:1.94.1-alpine
profiles:
- tools
working_dir: /app
volumes:
- ./services/search:/app
frontend-tests:
profiles:
- tools
build:
context: .
dockerfile: services/Dockerfile.frontend
target: tests
node-tools:
image: node:26-alpine
profiles:
- tools
working_dir: /app
volumes:
- ./services/frontend:/app
environment:
npm_config_cache: /tmp/npm
go-tools:
image: golang:1.26-alpine
profiles:
- tools
working_dir: /services
volumes:
- ./services:/services
postgres:
image: postgis/postgis:18-3.6
restart: unless-stopped
environment:
POSTGRES_DB: lolcatz
POSTGRES_USER: lolcatz
POSTGRES_PASSWORD: lolcatz
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql
healthcheck:
test:
- CMD-SHELL
- pg_isready -U lolcatz -d lolcatz
interval: 5s
timeout: 5s
retries: 10
redis:
image: docker.dragonflydb.io/dragonflydb/dragonfly:v1.37.0
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test:
- CMD
- redis-cli
- ping
interval: 5s
timeout: 5s
retries: 10
redpanda:
image: docker.redpanda.com/redpandadata/redpanda:v26.2.1
restart: unless-stopped
command:
- redpanda
- start
- --smp 1
- --memory 512M
- --overprovisioned
- --kafka-addr PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092
- --advertise-kafka-addr PLAINTEXT://redpanda:29092,OUTSIDE://localhost:9092
ports:
- "9092:9092"
- "9644:9644"
healthcheck:
test:
- CMD-SHELL
- rpk cluster info --brokers=localhost:29092 >/dev/null 2>&1
interval: 10s
timeout: 5s
retries: 15
redpanda-init:
image: docker.redpanda.com/redpandadata/redpanda:v26.2.1
entrypoint: |
/bin/bash -c "
until rpk cluster info --brokers redpanda:29092 >/dev/null 2>&1; do sleep 2; done
rpk topic create lolcatz-images --brokers redpanda:29092 -c cleanup.policy=compact || true
rpk topic create lolcatz-tags --brokers redpanda:29092 -c cleanup.policy=compact || true
"
minio:
networks:
default:
aliases:
- minio.localhost
image: pgsty/silo:RELEASE.2026-08-06T00-00-00Z
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data:/data
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:9000/minio/health/live
interval: 5s
timeout: 5s
retries: 10
minio-init:
image: pgsty/mc:RELEASE.2026-08-06T00-00-00Z
entrypoint: |
/bin/sh -c "
until mc alias set local http://minio:9000 minioadmin minioadmin; do sleep 2; done
mc mb --ignore-existing local/lolcatz-images
mc anonymous set download local/lolcatz-images
"
uploader:
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
build:
context: .
dockerfile: services/Dockerfile.golang
args:
SERVICE: uploader
restart: unless-stopped
environment:
DATABASE_URL: postgres://lolcatz:lolcatz@postgres:5432/lolcatz?sslmode=disable
S3_ENDPOINT: minio.localhost:9000
S3_USE_SSL: "false"
S3_ACCESS_KEY: minioadmin
S3_SECRET_KEY: minioadmin
S3_BUCKET: lolcatz-images
REDIS_ADDR: redis:6379
KAFKA_BROKERS: redpanda:29092
DEV_AUTH_TOKEN: lolcatz-local
DEV_AUTH_EMAIL: developer@localhost
ports:
- "8081:8080"
networks:
default:
aliases:
- lolcatz-uploader
healthcheck:
test:
- CMD
- wget
- -q
- -O
- /dev/null
- http://localhost:9090/health
interval: 5s
timeout: 3s
retries: 10
browse:
depends_on:
schema-init:
condition: service_completed_successfully
build:
context: .
dockerfile: services/Dockerfile.golang
args:
SERVICE: browse
restart: unless-stopped
environment:
DATABASE_URL: postgres://lolcatz:lolcatz@postgres:5432/lolcatz?sslmode=disable
S3_ENDPOINT: minio.localhost:9000
S3_USE_SSL: "false"
S3_ACCESS_KEY: minioadmin
S3_SECRET_KEY: minioadmin
S3_BUCKET: lolcatz-images
REDIS_ADDR: redis:6379
ADMIN_ENABLED: "true"
ports:
- "8082:8080"
networks:
default:
aliases:
- lolcatz-browse
healthcheck:
test:
- CMD
- wget
- -q
- -O
- /dev/null
- http://localhost:9090/health
interval: 5s
timeout: 3s
retries: 10
admin:
healthcheck:
test:
- CMD
- wget
- -q
- -O
- /dev/null
- http://localhost:9090/health
interval: 5s
timeout: 3s
retries: 10
build:
context: .
dockerfile: services/Dockerfile.golang
args:
SERVICE: admin
restart: unless-stopped
environment:
DATABASE_URL: postgres://lolcatz:lolcatz@postgres:5432/lolcatz?sslmode=disable
REDIS_ADDR: redis:6379
DEV_AUTH_TOKEN: lolcatz-local
depends_on:
uploader:
condition: service_healthy
schema-init:
image: postgis/postgis:18-3.6
environment:
PGHOST: postgres
PGUSER: lolcatz
PGPASSWORD: lolcatz
PGDATABASE: lolcatz
entrypoint:
- /bin/sh
- -ec
command:
- psql -v ON_ERROR_STOP=1 -c 'CREATE EXTENSION IF NOT EXISTS postgis' -f /schema/ocr.sql -f /schema/tagger.sql
volumes:
- ./services/ocr/schema.sql:/schema/ocr.sql:ro
- ./services/tagger/schema.sql:/schema/tagger.sql:ro
depends_on:
uploader:
condition: service_healthy
search:
depends_on:
schema-init:
condition: service_completed_successfully
build:
context: .
dockerfile: services/Dockerfile.search
restart: unless-stopped
environment:
DATABASE_URL: postgres://lolcatz:lolcatz@postgres:5432/lolcatz?sslmode=disable
ports:
- "8083:8080"
networks:
default:
aliases:
- lolcatz-search
healthcheck:
test: ["CMD", "/server", "--healthcheck"]
interval: 5s
timeout: 3s
retries: 10
comments:
depends_on:
uploader:
condition: service_healthy
build:
context: .
dockerfile: services/Dockerfile.golang
args:
SERVICE: comments
restart: unless-stopped
environment:
DATABASE_URL: postgres://lolcatz:lolcatz@postgres:5432/lolcatz?sslmode=disable
DEV_AUTH_TOKEN: lolcatz-local
DEV_AUTH_EMAIL: developer@localhost
ports:
- "8084:8080"
networks:
default:
aliases:
- lolcatz-comments
healthcheck:
test:
- CMD
- wget
- -q
- -O
- /dev/null
- http://localhost:9090/health
interval: 5s
timeout: 3s
retries: 10
exif:
build:
context: .
dockerfile: services/Dockerfile.golang
args:
SERVICE: exif
restart: unless-stopped
environment:
KAFKA_BROKERS: redpanda:29092
DATABASE_URL: postgres://lolcatz:lolcatz@postgres:5432/lolcatz?sslmode=disable
S3_ENDPOINT: minio.localhost:9000
S3_USE_SSL: "false"
S3_ACCESS_KEY: minioadmin
S3_SECRET_KEY: minioadmin
S3_BUCKET: lolcatz-images
depends_on:
schema-init:
condition: service_completed_successfully
redpanda:
condition: service_healthy
tagger-model:
profiles:
- ai
build:
context: .
dockerfile: services/Dockerfile.tagger-model
command:
- cp
- /yolov8n.pt
- /models/yolov8n.pt
volumes:
- tagger_model:/models
tagger:
profiles:
- ai
depends_on:
schema-init:
condition: service_completed_successfully
tagger-model:
condition: service_completed_successfully
redpanda:
condition: service_healthy
volumes:
- tagger_model:/models:ro
build:
context: .
dockerfile: services/Dockerfile.tagger
restart: unless-stopped
environment:
KAFKA_BROKERS: redpanda:29092
DATABASE_URL: postgres://lolcatz:lolcatz@postgres:5432/lolcatz?sslmode=disable
# Tagger fetches images from minio directly
S3_ENDPOINT: minio.localhost:9000
S3_USE_SSL: "false"
S3_ACCESS_KEY: minioadmin
S3_SECRET_KEY: minioadmin
S3_BUCKET: lolcatz-images
ocr:
build:
context: .
dockerfile: services/Dockerfile.ocr
restart: unless-stopped
environment:
DATABASE_URL: postgres://lolcatz:lolcatz@postgres:5432/lolcatz?sslmode=disable
KAFKA_BROKERS: redpanda:29092
S3_ENDPOINT: minio.localhost:9000
S3_USE_SSL: "false"
S3_ACCESS_KEY: minioadmin
S3_SECRET_KEY: minioadmin
S3_BUCKET: lolcatz-images
depends_on:
schema-init:
condition: service_completed_successfully
redpanda:
condition: service_healthy
thumbnailer: &thumbnailer
image: lolcatz-thumbnailer:latest
healthcheck:
test:
- CMD
- python
- -c
- import urllib.request; urllib.request.urlopen('http://localhost:9090/health', timeout=2)
interval: 5s
timeout: 3s
retries: 10
build:
context: .
dockerfile: services/Dockerfile.thumbnailer
restart: unless-stopped
environment:
DATABASE_URL: postgres://lolcatz:lolcatz@postgres:5432/lolcatz?sslmode=disable
S3_ENDPOINT: minio.localhost:9000
S3_USE_SSL: "false"
S3_ACCESS_KEY: minioadmin
S3_SECRET_KEY: minioadmin
S3_BUCKET: lolcatz-images
depends_on:
uploader:
condition: service_healthy
thumbnailer-worker:
<<: *thumbnailer
healthcheck:
disable: true
command:
- python
- worker.py
environment:
DATABASE_URL: postgres://lolcatz:lolcatz@postgres:5432/lolcatz?sslmode=disable
S3_ENDPOINT: minio.localhost:9000
S3_USE_SSL: "false"
S3_ACCESS_KEY: minioadmin
S3_SECRET_KEY: minioadmin
S3_BUCKET: lolcatz-images
KAFKA_BROKERS: redpanda:29092
depends_on:
uploader:
condition: service_healthy
redpanda:
condition: service_healthy
frontend:
healthcheck:
test:
- CMD
- node
- -e
- 'fetch(''http://localhost:9090/health'', {signal: AbortSignal.timeout(2000)}).then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))'
interval: 5s
timeout: 3s
retries: 20
build:
context: .
dockerfile: services/Dockerfile.frontend
args:
NEXT_PUBLIC_DEV_AUTH_TOKEN: lolcatz-local
restart: unless-stopped
environment:
NEXT_PUBLIC_DEV_AUTH_TOKEN: lolcatz-local
NEXTAUTH_URL: http://localhost:3000
BROWSE_URL: http://browse:8080
NEXTAUTH_SECRET: local-development-only
HOSTNAME: "0.0.0.0"
gateway:
image: nginx:1.27-alpine
restart: unless-stopped
read_only: true
depends_on:
- frontend
- browse
- thumbnailer
- search
- comments
- uploader
- admin
ports:
- "3000:8080"
volumes:
- ./gateway/nginx.conf:/etc/nginx/nginx.conf:ro
tmpfs:
- /var/cache/nginx
- /var/run
- /tmp
volumes:
tagger_model:
postgres_data:
minio_data:
redis_data: