-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
35 lines (32 loc) · 1011 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
35 lines (32 loc) · 1011 Bytes
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
version: "3.9"
services:
# Redis — our message broker and job store
redis:
image: redis:7-alpine
ports:
- "6379:6379" # expose Redis to host for debugging
volumes:
- redis_data:/data # persist data across container restarts
command: redis-server --appendonly yes # enable AOF persistence
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
# goqueue — our app
goqueue:
build: . # build from Dockerfile in current directory
ports:
- "8080:8080" # host:container port mapping
environment:
- REDIS_ADDR=redis:6379 # use service name, not localhost
- WORKER_COUNT=5
- API_PORT=8080
- MAX_RETRIES=3
depends_on:
redis:
condition: service_healthy # wait for Redis ping to succeed
restart: unless-stopped # auto-restart on crash
# Named volume — data persists even when containers are removed
volumes:
redis_data: