Skip to content

Commit

Permalink
Adding health check to sqlserver docker-compose and make it start 5 s…
Browse files Browse the repository at this point in the history
…econds after launching the container
  • Loading branch information
bpkroth committed Sep 30, 2024
1 parent c70d915 commit 767399e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-start-period 5s
ports:
- 1433:1433
steps:
Expand Down
6 changes: 6 additions & 0 deletions docker/sqlserver-latest/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ services:
container_name: sqlserver
hostname: sqlserver
image: mcr.microsoft.com/mssql/server:latest
healthcheck:
test: ["CMD", "/opt/mssql-tools/bin/sqlcmd", "-S", "localhost", "-U", "sa", "-P", "SApassword1", "-b", "-Q", "SELECT 1;"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
environment:
ACCEPT_EULA: Y
SA_PASSWORD: SApassword1
Expand Down

0 comments on commit 767399e

Please sign in to comment.