-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
50 lines (47 loc) · 1.57 KB
/
Copy pathdocker-compose.yml
File metadata and controls
50 lines (47 loc) · 1.57 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
41
42
43
44
45
46
47
48
49
50
version: "3.9"
# ─────────────────────────────────────────────────────────────────────────────
# Local development stack — spins up a Redis 7 instance with persistence
# ─────────────────────────────────────────────────────────────────────────────
services:
redis:
image: redis:7-alpine
container_name: ws-gateway-redis
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis-data:/data
# AOF persistence so channel state survives restarts during dev
command: redis-server --appendonly yes --appendfsync everysec
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# ── Uncomment to simulate a second gateway instance for scaling demos ──────
# gateway-1:
# build: .
# environment:
# - PORT=3001
# - REDIS_HOST=redis
# - INSTANCE_ID=instance-1
# ports:
# - "3001:3001"
# depends_on:
# redis:
# condition: service_healthy
#
# gateway-2:
# build: .
# environment:
# - PORT=3002
# - REDIS_HOST=redis
# - INSTANCE_ID=instance-2
# ports:
# - "3002:3002"
# depends_on:
# redis:
# condition: service_healthy
volumes:
redis-data:
driver: local