Skip to content

Commit

Permalink
Merge pull request pulp#549 from mdellweg/compose_readyness
Browse files Browse the repository at this point in the history
Add readiness probe to compose
  • Loading branch information
mdellweg committed Sep 19, 2023
2 parents d42d7a6 + f43c6ca commit acab2c7
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 4 deletions.
31 changes: 29 additions & 2 deletions images/compose/compose.folders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,28 @@ services:
volumes:
- "../../pgsql:/var/lib/postgresql:Z"
- "./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"
volumes:
- "redis_data:/data"
restart: always
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping" ]
interval: 10s
timeout: 5s
retries: 5

pulp_web:
image: "pulp/pulp-web:latest"
command: ['/usr/bin/nginx.sh']
depends_on:
postgres:
condition: service_healthy
pulp_api:
pulp_content:
ports:
Expand All @@ -34,6 +44,7 @@ services:
volumes:
- "./assets/bin/nginx.sh:/usr/bin/nginx.sh:Z"
- "./assets/nginx/nginx.conf.template:/etc/opt/rh/rh-nginx116/nginx/nginx.conf.template:Z"
restart: always

pulp_api:
image: "pulp/pulp-minimal:latest"
Expand All @@ -42,6 +53,7 @@ services:
command: ['pulp-api']
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
hostname: pulp-api
Expand All @@ -52,6 +64,12 @@ services:
- "../../pulp_storage:/var/lib/pulp:z"
environment:
PULP_DEFAULT_ADMIN_PASSWORD: password
restart: always
healthcheck:
test: [ "CMD-SHELL", "readyz.py /pulp/api/v3/status/" ]
interval: 10s
timeout: 5s
retries: 5

pulp_content:
image: "pulp/pulp-minimal:latest"
Expand All @@ -60,6 +78,7 @@ services:
command: ['pulp-content']
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
hostname: pulp-content
Expand All @@ -68,6 +87,12 @@ services:
- "./assets/settings.py:/etc/pulp/settings.py:z"
- "./assets/certs:/etc/pulp/certs:z"
- "../../pulp_storage:/var/lib/pulp:z"
restart: always
healthcheck:
test: [ "CMD-SHELL", "readyz.py /pulp/content/" ]
interval: 10s
timeout: 5s
retries: 5

pulp_worker:
image: "pulp/pulp-minimal:latest"
Expand All @@ -76,13 +101,15 @@ services:
command: ['pulp-worker']
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
user: pulp
volumes:
- "./assets/settings.py:/etc/pulp/settings.py:z"
- "./assets/certs:/etc/pulp/certs:z"
- "../../pulp_storage:/var/lib/pulp:z"
restart: always

volumes:
redis_data:
Expand Down
20 changes: 18 additions & 2 deletions images/compose/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ services:
volumes:
- "redis_data:/data"
restart: always
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping" ]
interval: 10s
timeout: 5s
retries: 5

pulp_web:
image: "pulp/pulp-web:latest"
command: ['/usr/bin/nginx.sh']
depends_on:
postgres:
condition: service_healthy
pulp_api:
pulp_content:
ports:
Expand All @@ -50,6 +53,7 @@ services:
command: ['pulp-api']
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
hostname: pulp-api
Expand All @@ -61,6 +65,11 @@ services:
environment:
PULP_DEFAULT_ADMIN_PASSWORD: password
restart: always
healthcheck:
test: [ "CMD-SHELL", "readyz.py /pulp/api/v3/status/" ]
interval: 10s
timeout: 5s
retries: 5

pulp_content:
image: "pulp/pulp-minimal:latest"
Expand All @@ -69,6 +78,7 @@ services:
command: ['pulp-content']
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
hostname: pulp-content
Expand All @@ -78,6 +88,11 @@ services:
- "./assets/certs:/etc/pulp/certs:z"
- "pulp:/var/lib/pulp"
restart: always
healthcheck:
test: [ "CMD-SHELL", "readyz.py /pulp/content/" ]
interval: 10s
timeout: 5s
retries: 5

pulp_worker:
image: "pulp/pulp-minimal:latest"
Expand All @@ -86,6 +101,7 @@ services:
command: ['pulp-worker']
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
user: pulp
Expand Down

0 comments on commit acab2c7

Please sign in to comment.