-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
96 lines (90 loc) · 2.14 KB
/
Copy pathdocker-compose.yml
File metadata and controls
96 lines (90 loc) · 2.14 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
version: '3.8'
services:
mongodb:
image: mongo:7.0
container_name: orderbook-mongodb
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
networks:
- orderbook-network
rabbitmq:
image: rabbitmq:3.12-management
container_name: orderbook-rabbitmq
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
volumes:
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 10s
timeout: 5s
retries: 5
networks:
- orderbook-network
command-service:
build:
context: .
dockerfile: docker/Dockerfile.command
container_name: orderbook-command
ports:
- "8081:8081"
environment:
SPRING_PROFILES_ACTIVE: docker
MONGODB_URI: mongodb://mongodb:27017/orderbook
RABBITMQ_HOST: rabbitmq
depends_on:
mongodb:
condition: service_healthy
rabbitmq:
condition: service_healthy
healthcheck:
test: curl -f http://localhost:8081/actuator/health || exit 1
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- orderbook-network
query-service:
build:
context: .
dockerfile: docker/Dockerfile.query
container_name: orderbook-query
ports:
- "8082:8082"
environment:
SPRING_PROFILES_ACTIVE: docker
MONGODB_URI: mongodb://mongodb:27017/orderbook
RABBITMQ_HOST: rabbitmq
depends_on:
mongodb:
condition: service_healthy
rabbitmq:
condition: service_healthy
command-service:
condition: service_healthy
healthcheck:
test: curl -f http://localhost:8082/actuator/health || exit 1
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- orderbook-network
volumes:
mongodb_data:
rabbitmq_data:
networks:
orderbook-network:
driver: bridge