Docker Compose for BullMQ + Redis
Node.js BullMQ job queue with Redis. Reliable job processing for Node apps.
node bullmq redis queue worker
compose.yaml
services:
api:
build: .
ports:
- target: 3000
mode: ingress
environment:
- REDIS_URL=redis://redis:6379
- NODE_ENV=production
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:3000/
interval: 30s
timeout: 5s
retries: 3
depends_on:
- redis
deploy:
resources:
reservations:
cpus: "0.5"
memory: 256M
restart: unless-stopped
worker:
build: .
command: node worker.js
environment:
- REDIS_URL=redis://redis:6379
- NODE_ENV=production
depends_on:
- redis
deploy:
resources:
reservations:
cpus: "0.5"
memory: 256M
restart: unless-stopped
redis:
image: redis:7-alpine
ports:
- target: 6379
mode: host
healthcheck:
test:
- CMD
- redis-cli
- ping
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
reservations:
cpus: "0.5"
memory: 256M
restart: unless-stopped
x-defang-redis: true
Services
- api .
- worker .
- redis redis:7-alpine