forked from rodrigobotti/rs-ec-2021-circuit-breaker
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathdocker-compose.yml
70 lines (63 loc) · 1.3 KB
/
docker-compose.yml
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
version: '3'
x-backend-service: &backend-app
build: .
command: 'npm run start:backend'
expose:
- 3000
networks:
- example-3
deploy:
resources:
limits:
cpus: '0.5'
memory: 128M
services:
client-service:
build: .
command: 'npm run start:client'
environment:
- SERVICE_NAME=client-service
- PORT=3000
- BACKEND_SERVICE_URL=http://haproxy:4000/backend/api
expose:
- 3000
networks:
- example-3
ports:
- 3000:3000
deploy:
resources:
limits:
cpus: '0.5'
memory: 128M
backend-service-node-1:
<<: *backend-app
environment:
- SERVICE_NAME=backend-service
- PORT=3000
- FORCE_ERROR=false
backend-service-node-2:
<<: *backend-app
environment:
- SERVICE_NAME=backend-service
- PORT=3000
- FORCE_ERROR=true
haproxy:
image: haproxy:2.4-alpine
expose:
- 4000
- 8080
environment:
- FRONT_PORT=4000
- STATS_PORT=8080
- BACKEND_SERVER_1=backend-service-node-1
- BACKEND_SERVER_2=backend-service-node-2
- BACKEND_SERVER_PORT=3000
ports:
- 8080:8080
volumes:
- ./src/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
networks:
- example-3
networks:
example-3: