-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
62 lines (57 loc) · 1.32 KB
/
docker-compose.yaml
File metadata and controls
62 lines (57 loc) · 1.32 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
51
52
53
54
55
56
57
58
59
60
61
62
version: '3.8'
services:
# 1. Redis with Healthcheck (The Foundation)
redis:
image: redis:alpine
container_name: trib-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
restart: always
# This acts as the "Traffic Light" for other services
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
# 2. Redis Commander (GUI)
redis-commander:
image: rediscommander/redis-commander:latest
container_name: trib-gui
environment:
- REDIS_HOSTS=local:redis:6379
ports:
- "8081:8081"
depends_on:
redis:
condition: service_healthy # Waits for Redis PONG
# 3. The Trading Engine
engine:
build:
context: .
dockerfile: Dockerfile.engine
container_name: trib-engine
restart: always
environment:
- REDIS_ADDR=redis:6379
depends_on:
redis:
condition: service_healthy # CRITICAL: Won't start until Redis is ready
# 4. The API Layer
api:
build:
context: .
dockerfile: Dockerfile.api
container_name: trib-api
ports:
- "3000:3000"
restart: always
environment:
- REDIS_ADDR=redis:6379
depends_on:
redis:
condition: service_healthy
volumes:
redis_data: