Skip to content

Commit 4d80fa2

Browse files
Adding healthcheck
1 parent 141393d commit 4d80fa2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,18 +305,25 @@ services:
305305
environment:
306306
SA_PASSWORD: "!MyComplexPassword"
307307
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
308314
networks:
309315
- graphqlstore
310316

311317
webapi:
312318
container_name: webapi
313319
image: antoniofalcaojr/dotnet5-graphql3-webapi
314320
environment:
315-
- ASPNETCORE_URLS=http://*:5000
321+
- ASPNETCORE_URLS=http://*:5000
316322
ports:
317323
- 5000:5000
318324
depends_on:
319-
- mssql
325+
mssql:
326+
condition: service_healthy
320327
networks:
321328
- graphqlstore
322329

@@ -328,7 +335,7 @@ services:
328335
ports:
329336
- 7000:7000
330337
depends_on:
331-
- webapi
338+
- webapi
332339
networks:
333340
- graphqlstore
334341

0 commit comments

Comments
 (0)