feat: Add healthcheck for pg
This commit is contained in:
+9
-2
@@ -12,8 +12,10 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- HISTFILE=/usr/src/app/log/.bash_history
|
- HISTFILE=/usr/src/app/log/.bash_history
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
db:
|
||||||
- redis
|
condition: service_healthy
|
||||||
|
redis:
|
||||||
|
condition: service_started
|
||||||
db:
|
db:
|
||||||
image: postgres:15
|
image: postgres:15
|
||||||
ports:
|
ports:
|
||||||
@@ -22,6 +24,11 @@ services:
|
|||||||
- POSTGRES_PASSWORD=changeme
|
- POSTGRES_PASSWORD=changeme
|
||||||
volumes:
|
volumes:
|
||||||
- pg_data:/var/lib/postgresql/data
|
- pg_data:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: pg_isready -U postgres
|
||||||
|
interval: 2s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 30
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
Reference in New Issue
Block a user