forked from mobile-cloud-computing/ds-practice-2024
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
132 lines (122 loc) · 3.91 KB
/
docker-compose.yaml
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
version: '3'
services:
frontend:
build:
# Use the current directory as the build context
# This allows us to access the files in the current directory inside the Dockerfile
context: ./
dockerfile: ./frontend/Dockerfile
ports:
# Expose port 8080 on the host, and map port 3000 of the container to port 8080 on the host
- "8080:3000"
volumes:
- /app/node_modules
environment:
- CHOKIDAR_USEPOLLING=true
- WDS_SOCKET_PORT=0
orchestrator:
build:
# Use the current directory as the build context
# This allows us to access the files in the current directory inside the Dockerfile
context: ./
# Use the Dockerfile in the orchestrator directory
dockerfile: ./orchestrator/Dockerfile
ports:
# Expose port 8081 on the host, and map port 5000 of the container to port 8081 on the host
- 8081:5000
environment:
# Pass the environment variables to the container
# The PYTHONUNBUFFERED environment variable ensures that the output from the application is logged to the console
- PYTHONUNBUFFERED=TRUE
# The PYTHONFILE environment variable specifies the absolute entry point of the application
# Check app.py in the orchestrator directory to see how this is used
- PYTHONFILE=/app/orchestrator/src/app/run.py
fraud-detection:
build:
# Use the current directory as the build context
# This allows us to access the files in the current directory inside the Dockerfile
context: ./
# Use the Dockerfile in the fraud_detection directorys
dockerfile: ./fraud_detection/Dockerfile
ports:
# Expose port 50051 on the host, and map port 50051 of the container to port 50051 on the host
- 50051:50051
environment:
# Pass the environment variables to the container
# The PYTHONUNBUFFERED environment variable ensures that the output from the application is logged to the console
- PYTHONUNBUFFERED=TRUE
# The PYTHONFILE environment variable specifies the absolute entry point of the application
# Check app.py in the fraud_detection directory to see how this is used
- PYTHONFILE=/app/fraud_detection/src/app.py
transaction-verification:
build:
context: ./
dockerfile: ./transaction_verification/Dockerfile
ports:
- "50052:50052"
environment:
- PYTHONUNBUFFERED=TRUE
- PYTHONFILE=/app/transaction_verification/src/run.py
suggestions-service:
build:
context: ./
dockerfile: ./suggestions_service/Dockerfile
ports:
- "50053:50053"
environment:
- PYTHONUNBUFFERED=TRUE
- PYTHONFILE=/app/transaction_verification/src/run.py
database:
build:
context: ./
dockerfile: ./database/Dockerfile
ports:
- "50060:50060"
environment:
- NODE_ID=database
- PEERS=raft_node_2:50060,raft_node_3:50060
raft_node_2:
build:
context: ./
dockerfile: ./database/Dockerfile
ports:
- "50061:50060"
environment:
- NODE_ID=raft_node_2
- PEERS=database:50060,raft_node_3:50060
raft_node_3:
build:
context: ./
dockerfile: ./database/Dockerfile
ports:
- "50062:50060"
environment:
- NODE_ID=raft_node_3
- PEERS=database:50060,raft_node_2:50060
queue:
build:
context: ./
dockerfile: ./queue/Dockerfile
ports:
- "50055:50055"
environment:
- PYTHONUNBUFFERED=TRUE
- PYTHONFILE=/app/queue/src/run.py
executor:
build:
context: ./
dockerfile: ./executor/Dockerfile
deploy:
replicas: 2
environment:
- PYTHONUNBUFFERED=TRUE
- PYTHONFILE=/app/executor/src/run.py
payment-service:
build:
context: ./
dockerfile: ./payment_service/Dockerfile
ports:
- 50056:50056
environment:
- PYTHONUNBUFFERED=TRUE
- PYTHONFILE=/app/payment_service/src/app/run.py