Refactored redis component to use a centralized postgres database with coordinator instead of descentralized sqlite shitty databases

This commit is contained in:
2026-06-30 18:07:47 -03:00
parent bae8712f3b
commit e81211c88e
10 changed files with 854 additions and 193 deletions
+21 -5
View File
@@ -2,21 +2,38 @@ services:
redis:
image: redis:7-alpine
command: ["redis-server", "--appendonly", "yes", "--bind", "0.0.0.0", "--protected-mode", "no"]
ports:
- "6379:6379"
volumes:
- camfinder-redis:/data
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: camfinder
POSTGRES_USER: camfinder
POSTGRES_PASSWORD: camfinder
volumes:
- camfinder-postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U camfinder -d camfinder"]
interval: 5s
timeout: 5s
retries: 10
start_period: 5s
coordinator:
build: .
command: ["redis-coordinator"]
environment:
REDIS_URL: redis://redis:6379/0
DATABASE_URL: postgres://camfinder:camfinder@postgres:5432/camfinder
RTSP_QUEUE_NAME: camfinder:rtsp:queue
RTSP_INPUT_CSV: /app/camfinder-open-rtsp.csv
RTSP_WORKER_COUNT: 2
depends_on:
- redis
redis:
condition: service_started
postgres:
condition: service_healthy
volumes:
- ./:/app
@@ -27,7 +44,6 @@ services:
REDIS_URL: redis://redis:6379/0
RTSP_QUEUE_NAME: camfinder:rtsp:queue
RTSP_SNAPSHOT_DIR: /app/dump/feeds
RTSP_SQLITE_PATH: /app/dump/rtsp-results.sqlite
RTSP_CAPTURE_TIMEOUT_MS: 15000
depends_on:
- redis
@@ -42,7 +58,6 @@ services:
REDIS_URL: redis://redis:6379/0
RTSP_QUEUE_NAME: camfinder:rtsp:queue
RTSP_SNAPSHOT_DIR: /app/dump/feeds
RTSP_SQLITE_PATH: /app/dump/rtsp-results.sqlite
RTSP_CAPTURE_TIMEOUT_MS: 15000
depends_on:
- redis
@@ -52,3 +67,4 @@ services:
volumes:
camfinder-redis:
camfinder-postgres: