File tree 2 files changed +21
-8
lines changed 2 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -305,18 +305,25 @@ services:
305
305
environment:
306
306
SA_PASSWORD: "!MyComplexPassword"
307
307
ACCEPT_EULA: "Y"
308
+ healthcheck:
309
+ test: /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$$SA_PASSWORD" -Q "SELECT 1" || exit 1
310
+ interval: 10s
311
+ timeout: 3s
312
+ retries: 10
313
+ start_period: 10s
308
314
networks:
309
315
- graphqlstore
310
316
311
317
webapi:
312
318
container_name: webapi
313
319
image: antoniofalcaojr/dotnet5-graphql3-webapi
314
320
environment:
315
- - ASPNETCORE_URLS= http : // *:5000
321
+ - ASPNETCORE_URLS= http : // *:5000
316
322
ports :
317
323
- 5000 : 5000
318
324
depends_on :
319
- - mssql
325
+ mssql :
326
+ condition : service_healthy
320
327
networks :
321
328
- graphqlstore
322
329
@@ -328,7 +335,7 @@ services:
328
335
ports :
329
336
- 7000 : 7000
330
337
depends_on :
331
- - webapi
338
+ - webapi
332
339
networks :
333
340
- graphqlstore
334
341
Original file line number Diff line number Diff line change 1
1
version : " 3.7"
2
2
3
3
services :
4
-
5
4
mssql :
6
5
container_name : mssql
7
6
image : mcr.microsoft.com/mssql/server
@@ -10,6 +9,12 @@ services:
10
9
environment :
11
10
SA_PASSWORD : " !MyComplexPassword"
12
11
ACCEPT_EULA : " Y"
12
+ healthcheck :
13
+ test : /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$$SA_PASSWORD" -Q "SELECT 1" || exit 1
14
+ interval : 10s
15
+ timeout : 3s
16
+ retries : 10
17
+ start_period : 10s
13
18
networks :
14
19
- graphqlstore
15
20
@@ -23,10 +28,11 @@ services:
23
28
- ASPNETCORE_URLS=http://*:5000
24
29
ports :
25
30
- 5000:5000
31
+ depends_on :
32
+ mssql :
33
+ condition : service_healthy
26
34
networks :
27
35
- graphqlstore
28
- depends_on :
29
- - mssql
30
36
31
37
webmvc :
32
38
container_name : webmvc
@@ -38,10 +44,10 @@ services:
38
44
- ASPNETCORE_URLS=http://*:7000
39
45
ports :
40
46
- 7000:7000
41
- networks :
42
- - graphqlstore
43
47
depends_on :
44
48
- webapi
49
+ networks :
50
+ - graphqlstore
45
51
46
52
networks :
47
53
graphqlstore :
You can’t perform that action at this time.
0 commit comments