Skip to content

Commit 00ddf2f

Browse files
Add psql healthchecks
1 parent 8a5157b commit 00ddf2f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docker-compose.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ services:
2828
POSTGRES_DB: postgres
2929
ports:
3030
- "5432:5432"
31+
healthcheck:
32+
test: [ "CMD", "pg_isready", "-d", "postgres", "-U", "arch" ]
33+
interval: 5s
34+
timeout: 5s
35+
retries: 3
3136

3237
postgresdb:
3338
image: postgres:${POSTGRES_VERSION:-latest}
@@ -38,6 +43,11 @@ services:
3843
networks:
3944
inner:
4045
ipv4_address: 10.5.0.5
46+
healthcheck:
47+
test: [ "CMD", "pg_isready", "-d", "postgres", "-U", "arch" ]
48+
interval: 5s
49+
timeout: 5s
50+
retries: 3
4151

4252
postgres_ssl:
4353
image: postgres:${POSTGRES_VERSION:-latest}
@@ -56,6 +66,11 @@ services:
5666
- ./ssl/pg_hba.conf:/var/lib/postgresql/pg_hba.conf # Configuration file to allow connection over SSL.
5767
ports:
5868
- "5433:5432"
69+
healthcheck:
70+
test: [ "CMD", "pg_isready", "-d", "postgres", "-U", "arch" ]
71+
interval: 5s
72+
timeout: 5s
73+
retries: 3
5974

6075
postgres_log_based:
6176
image: meltano/log_based # Locally built
@@ -68,6 +83,11 @@ services:
6883
- ./log_based:/docker-entrypoint-initdb.d
6984
ports:
7085
- "5434:5432"
86+
healthcheck:
87+
test: [ "CMD", "pg_isready", "-d", "postgres", "-U", "arch" ]
88+
interval: 5s
89+
timeout: 5s
90+
retries: 3
7191

7292

7393
networks:

0 commit comments

Comments
 (0)