Skip to content

Commit 006ed38

Browse files
committed
feat: Add database healthcheck to Docker Compose and spin up database in frontend workflow
1 parent d3d8fcc commit 006ed38

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/frontend.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ jobs:
5252
env:
5353
ASPNETCORE_ENVIRONMENT: Development
5454

55+
- name: Spin up Database with Docker Compose
56+
run: docker compose up database -d --wait
57+
5558
- name: Wait for API to be ready
5659
uses: jtalk/url-health-check-action@v4
5760
with:

compose.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
- "5432:5432"
3232
volumes:
3333
- db_data:/var/lib/postgresql/data
34+
healthcheck:
35+
test: ["CMD-SHELL", "pg_isready -U bankuser -d bankdb"]
36+
interval: 10s
37+
timeout: 5s
38+
retries: 5
39+
start_period: 10s
3440

3541
volumes:
3642
db_data:

0 commit comments

Comments
 (0)