-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
254 lines (241 loc) · 6.12 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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
services:
mongodb:
container_name: mongodb_container
image: mongo:8.0.3
ports:
- "27017:27017"
restart: always
environment:
ASPNETCORE_ENVIRONMENT: "Development"
healthcheck:
test: [ "CMD", "mongosh", "--eval", "db.runCommand({ ping: 1 })" ]
interval: 5s
timeout: 10s
retries: 5
volumes:
- mongo_data:/data/db
networks:
- elastic
deploy:
resources:
limits:
cpus: '0.5'
memory: 1g
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.5.1
container_name: elasticsearch_container
ports:
- "9200:9200"
volumes:
- elasticsearch_config:/usr/share/elasticsearch/config
- elasticsearch_data:/usr/share/elasticsearch/data
- ./elasticsearch/config/notes_index_template.json:/usr/share/elasticsearch/config/notes_index_template.json
- ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9200/_cat/health" ]
interval: 10s
timeout: 10s
retries: 10
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- ingest.geoip.downloader.enabled=false
networks:
- elastic
deploy:
resources:
limits:
memory: 2g
init-template:
image: curlimages/curl:8.11.0
container_name: init-template
depends_on:
- elasticsearch
entrypoint: >
/bin/sh -c "
echo 'Waiting for Elasticsearch to be ready...';
until curl -s http://elasticsearch:9200/_cat/health > /dev/null; do
sleep 5;
done;
echo 'Elasticsearch is ready. Loading index template...';
curl -X PUT 'http://elasticsearch:9200/_index_template/notes_index_template' \
-H 'Content-Type: application/json' \
-d @/usr/share/elasticsearch/config/notes_index_template.json;
echo 'Template loaded successfully!';"
volumes:
- ./elasticsearch/config/notes_index_template.json:/usr/share/elasticsearch/config/notes_index_template.json
networks:
- elastic
mongo-express:
image: mongo-express
container_name: mongo_express
build:
context: ./mongodb
dockerfile: mongo-express.Dockerfile
volumes:
- ./mongodb:/mongodb
ports:
- "8081:8081"
environment:
- ME_CONFIG_MONGODB_URL=mongodb://mongodb_container:27017
depends_on:
mongodb:
condition: service_healthy
networks:
- elastic
deploy:
resources:
limits:
cpus: '0.25'
memory: 512m
apigateway:
container_name: apigateway
build:
context: .
dockerfile: ApiGateway/apigateway.Dockerfile
env_file:
- .env
environment:
- Configuration=Docker
- ASPNETCORE_URLS=http://*:5000
ports:
- "5000:5000"
networks:
- elastic
deploy:
resources:
limits:
cpus: '0.5'
memory: 512m
auth:
container_name: auth
build:
context: .
dockerfile: Auth/auth.Dockerfile
env_file:
- .env
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- Configuration=Docker
- ASPNETCORE_URLS=http://*:7201
- ConnectionStrings__DockerInternal=Server=host.docker.internal,1433;Database=AuthServiceDb;User Id=${DB_USER};Password=${DB_PASSWORD};MultipleActiveResultSets=true;TrustServerCertificate=True;
volumes:
- data_protection_keys:/root/.aspnet/DataProtection-Keys
ports:
- "7201:7201"
networks:
- elastic
deploy:
resources:
limits:
cpus: '0.25'
memory: 512m
backendpatient:
container_name: backendpatient
build:
context: .
dockerfile: BackendPatient/backendpatient.Dockerfile
env_file:
- .env
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- Configuration=Docker
- ASPNETCORE_URLS=http://*:7200
- ConnectionStrings__DockerInternal=Server=host.docker.internal,1433;Database=PatientDb;User Id=${DB_USER};Password=${DB_PASSWORD};MultipleActiveResultSets=true;TrustServerCertificate=True;
volumes:
- data_protection_keys:/root/.aspnet/DataProtection-Keys
ports:
- "7200:7200"
networks:
- elastic
deploy:
resources:
limits:
cpus: '0.25'
memory: 512m
backendnote:
container_name: backendnote
build:
context: .
dockerfile: BackendNote/backendnote.Dockerfile
env_file:
- .env
depends_on:
elasticsearch:
condition: service_healthy
mongodb:
condition: service_healthy
environment:
- Configuration=Docker
- ASPNETCORE_URLS=http://*:7202
ports:
- "7202:7202"
networks:
- elastic
deploy:
resources:
limits:
cpus: '0.25'
memory: 512m
backenddiabetesriskprediction:
container_name: backenddiabetesriskprediction
build:
context: .
dockerfile: BackendDiabetesRiskPrediction/backenddiabetesriskprediction.Dockerfile
env_file:
- .env
depends_on:
- elasticsearch
- mongodb
environment:
- Configuration=Docker
- ASPNETCORE_URLS=http://*:7204
ports:
- "7204:7204"
networks:
- elastic
deploy:
resources:
limits:
cpus: '0.5'
memory: 512m
frontend:
image: frontend-image
container_name: frontend
build:
context: .
dockerfile: Frontend/frontend.Dockerfile
env_file:
- .env
ports:
- "7000:7000"
volumes:
- shared-output:/app/shared
- ./Frontend/Views/:/app/Views/
environment:
- Configuration=Docker
- ASPNETCORE_URLS=http://*:7000
depends_on:
- backendpatient
- apigateway
networks:
- elastic
deploy:
resources:
limits:
cpus: '0.5'
memory: 1g
volumes:
mongo_data:
driver: local
elasticsearch_config:
driver: local
elasticsearch_data:
driver: local
shared-output:
data_protection_keys:
networks:
elastic:
driver: bridge