Skip to content

Commit

Permalink
Add readiness check to postgres
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
mdellweg committed Jun 27, 2023
1 parent 0559151 commit f112f39
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
22 changes: 13 additions & 9 deletions images/compose/compose.folders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ services:
image: "pulp/pulp-web:latest"
command: ['/usr/bin/nginx.sh']
depends_on:
- postgres
- pulp_api
- pulp_content
postgres:
condition: service_healthy
pulp_api:
pulp_content:
ports:
- "8080:8080"
hostname: pulp
Expand All @@ -40,8 +41,9 @@ services:
replicas: 2
command: ['pulp-api']
depends_on:
- redis
- postgres
redis:
postgres:
condition: service_healthy
hostname: pulp-api
user: pulp
volumes:
Expand All @@ -59,8 +61,9 @@ services:
replicas: 2
command: ['pulp-content']
depends_on:
- redis
- postgres
redis:
postgres:
condition: service_healthy
hostname: pulp-content
user: pulp
volumes:
Expand All @@ -77,8 +80,9 @@ services:
replicas: 2
command: ['pulp-worker']
depends_on:
- redis
- postgres
redis:
postgres:
condition: service_healthy
user: pulp
volumes:
- "./assets/settings.py:/etc/pulp/settings.py:z"
Expand Down
27 changes: 18 additions & 9 deletions images/compose/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ services:
- "pg_data:/var/lib/postgresql"
- "./assets/postgres/passwd:/etc/passwd:Z"
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U pulp" ]
interval: 10s
timeout: 5s
retries: 5

redis:
image: "docker.io/library/redis:latest"
Expand All @@ -25,9 +30,10 @@ services:
image: "pulp/pulp-web:latest"
command: ['/usr/bin/nginx.sh']
depends_on:
- postgres
- pulp_api
- pulp_content
postgres:
condition: service_healthy
pulp_api:
pulp_content:
ports:
- "8080:8080"
hostname: pulp
Expand All @@ -43,8 +49,9 @@ services:
replicas: 2
command: ['pulp-api']
depends_on:
- redis
- postgres
redis:
postgres:
condition: service_healthy
hostname: pulp-api
user: pulp
volumes:
Expand All @@ -63,8 +70,9 @@ services:
replicas: 2
command: ['pulp-content']
depends_on:
- redis
- postgres
redis:
postgres:
condition: service_healthy
hostname: pulp-content
user: pulp
volumes:
Expand All @@ -82,8 +90,9 @@ services:
replicas: 2
command: ['pulp-worker']
depends_on:
- redis
- postgres
redis:
postgres:
condition: service_healthy
user: pulp
volumes:
- "./assets/settings.py:/etc/pulp/settings.py:z"
Expand Down

0 comments on commit f112f39

Please sign in to comment.