Skip to content

Commit 9550214

Browse files
committed
Add a health check for the db service
[refs #87b1edef5b20]
1 parent 4692ca6 commit 9550214

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

swarm/swarm-demo-frontend/docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ services:
1717
- pg-data:/var/lib/postgresql/data
1818
env_file:
1919
- config/db.env
20+
healthcheck:
21+
test: echo "SELECT * FROM requests LIMIT 1" | psql -h localhost -U $$POSTGRES_USER || exit 1
22+
interval: 10s
23+
retries: 2
24+
start_period: 2m
2025

2126
lb:
2227
image: jfahrer/swarm-demo-lb:v1

0 commit comments

Comments
 (0)