From: halil.cakal Date: Tue, 10 Jun 2025 12:27:40 +0000 (+0100) Subject: Optimize healthcheck parameters for dbpostgres X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=d00bcc477d905cb7868a33913fdadb9c0d2355b6;p=cps.git Optimize healthcheck parameters for dbpostgres - provide db name and user to pg_isready in order to remove logs: FATAL: role "root" does not exist - optimize the healthcheck parameters Issue-ID: CPS-2694 Change-Id: I1aa6330909e3e4a1a0c0b486b2cd3603b743472c Signed-off-by: halil.cakal --- diff --git a/docker-compose/cps-base.yml b/docker-compose/cps-base.yml index 2a7e9c8432..78d77b588d 100644 --- a/docker-compose/cps-base.yml +++ b/docker-compose/cps-base.yml @@ -46,12 +46,10 @@ services: cpus: '6' memory: 3G healthcheck: - test: pg_isready || exit 1 # This command runs inside the container, returning 0 for success, non-zero for failure. - timeout: 1s # Time-out of the above test command. - interval: 2s # How often the health is run. - retries: 100 # If 3 health checks fail, the container is unhealthy. - start_period: 210s # Ignore failed health checks for first 30 seconds, to give system time to start - ### Full start-up time allowed = 30 seconds start period + 3 tries * 10 seconds interval = 60 seconds + test: pg_isready -U ${DB_USERNAME:-cps} -d cpsdb || exit 1 # This command runs inside the container, returning 0 for success, non-zero for failure. + timeout: 110s # Time-out of the above test command. + interval: 10s # How often the health is run. + retries: 10 # If 10 health checks fail, the container is unhealthy. cps-and-ncmp-template: image: ${DOCKER_REPO:-nexus3.onap.org:10003}/onap/cps-and-ncmp:${CPS_VERSION:-latest}