72 lines
2 KiB
YAML
72 lines
2 KiB
YAML
# =============================================================================
|
|
# QUEUE WORKER SERVICE INFRASTRUCTURE
|
|
# =============================================================================
|
|
#
|
|
# Centralized job queue processing service:
|
|
# - Redis: Dedicated BullMQ queue storage (all platform queues)
|
|
# - Worker: NestJS service that processes jobs and delegates to feature APIs
|
|
#
|
|
# =============================================================================
|
|
|
|
services:
|
|
queue-redis:
|
|
image: redis:7.4-alpine
|
|
container_name: lilith-platform-queue-redis
|
|
restart: unless-stopped
|
|
ports:
|
|
- '${QUEUE_REDIS_PORT:-26388}:6379'
|
|
environment:
|
|
REDIS_PASSWORD: ${QUEUE_REDIS_PASSWORD:-queue_dev_password}
|
|
volumes:
|
|
- queue-redis-data:/data
|
|
command:
|
|
- redis-server
|
|
- --requirepass
|
|
- "${QUEUE_REDIS_PASSWORD:-queue_dev_password}"
|
|
- --appendonly
|
|
- "yes"
|
|
- --maxmemory
|
|
- "${QUEUE_REDIS_MAX_MEMORY:-512mb}"
|
|
- --maxmemory-policy
|
|
- "noeviction"
|
|
healthcheck:
|
|
test: ['CMD', 'redis-cli', '-a', '${QUEUE_REDIS_PASSWORD:-queue_dev_password}', 'ping']
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 5
|
|
networks:
|
|
- queue-network
|
|
|
|
queue-worker:
|
|
build:
|
|
context: ../../../services/queue-worker
|
|
dockerfile: Dockerfile
|
|
container_name: lilith-queue-worker
|
|
restart: unless-stopped
|
|
ports:
|
|
- '${QUEUE_WORKER_API_PORT:-3080}:3080'
|
|
- '${QUEUE_WORKER_WS_PORT:-3081}:3081'
|
|
environment:
|
|
- NODE_ENV=${NODE_ENV:-production}
|
|
- REDIS_URL=redis://:${QUEUE_REDIS_PASSWORD:-queue_dev_password}@queue-redis:6379
|
|
- PORT=3080
|
|
- WS_PORT=3081
|
|
- LOG_LEVEL=${LOG_LEVEL:-info}
|
|
depends_on:
|
|
queue-redis:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ['CMD', 'curl', '-f', 'http://localhost:3080/health']
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
networks:
|
|
- queue-network
|
|
|
|
volumes:
|
|
queue-redis-data:
|
|
|
|
networks:
|
|
queue-network:
|
|
driver: bridge
|