-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
40 lines (37 loc) · 1.12 KB
/
Copy pathdocker-compose.yml
File metadata and controls
40 lines (37 loc) · 1.12 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
version: '3.8'
services:
queue:
build: .
container_name: job-queue
ports:
- "8080:8080"
volumes:
- ./data:/app/data # WAL persistence across restarts
environment:
# Server configuration
- PORT=8080 # HTTP server port
- WAL_DIR=/app/data # Write-Ahead Log directory
- LEASE_DURATION=30s # How long workers can hold a job
- LEASE_CHECK_INTERVAL=5s # How often to check for expired leases
# Redis configuration
- REDIS_URL=redis:6379 # Redis connection URL
depends_on:
- redis
restart: unless-stopped # Auto-restart on crash (not on manual stop)
redis:
image: redis:7-alpine
container_name: job-queue-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
command: redis-server --appendonly yes --appendfsync everysec
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
volumes:
redis-data:
driver: local