Skip to content

Commit d8859d5

Browse files
CopilotPhantomDave
andcommitted
Improve database healthcheck configuration for better reliability
Co-authored-by: PhantomDave <34485699+PhantomDave@users.noreply.github.com>
1 parent ff6bcdb commit d8859d5

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

compose.dev.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ services:
1414
volumes:
1515
- db_data_dev:/var/lib/postgresql/data
1616
healthcheck:
17-
test: ["CMD-SHELL", "pg_isready -U bankuser -d bankdb"]
17+
test: ["CMD-SHELL", "pg_isready -U bankuser -d bankdb || exit 1"]
1818
interval: 10s
1919
timeout: 5s
20-
retries: 5
21-
start_period: 10s
20+
retries: 10
21+
start_period: 30s
2222
restart: unless-stopped
2323

2424
volumes:

compose.local.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ services:
1616
networks:
1717
- banktracking-network
1818
healthcheck:
19-
test: ["CMD-SHELL", "pg_isready -U bankuser -d bankdb"]
19+
test: ["CMD-SHELL", "pg_isready -U bankuser -d bankdb || exit 1"]
2020
interval: 10s
2121
timeout: 5s
22-
retries: 5
23-
start_period: 10s
22+
retries: 10
23+
start_period: 30s
2424
restart: unless-stopped
2525

2626
backend:

compose.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
networks:
1414
- banktracking-network
1515
healthcheck:
16-
test: ["CMD-SHELL", "pg_isready -U bankuser -d bankdb"]
16+
test: ["CMD-SHELL", "pg_isready -U bankuser -d bankdb || exit 1"]
1717
interval: 10s
1818
timeout: 5s
19-
retries: 5
20-
start_period: 10s
19+
retries: 10
20+
start_period: 30s
2121
restart: unless-stopped
2222

2323
backend:

0 commit comments

Comments
 (0)