feat: Add healthcheck for pg

This commit is contained in:
Ryan W
2023-05-04 14:16:25 -07:00
parent abe4c4f322
commit 95a282c9a1
+9 -2
View File
@@ -12,8 +12,10 @@ services:
environment:
- HISTFILE=/usr/src/app/log/.bash_history
depends_on:
- db
- redis
db:
condition: service_healthy
redis:
condition: service_started
db:
image: postgres:15
ports:
@@ -22,6 +24,11 @@ services:
- POSTGRES_PASSWORD=changeme
volumes:
- pg_data:/var/lib/postgresql/data
healthcheck:
test: pg_isready -U postgres
interval: 2s
timeout: 5s
retries: 30
redis:
image: redis
volumes: