guild-operators icon indicating copy to clipboard operation
guild-operators copied to clipboard

Docker container healthcheck for CNCLI usage

Open adamsthws opened this issue 10 months ago • 9 comments

Hello,

I wonder if it makes sense to request an improvement to the builtin healthcheck of the Docker container? ... When enabling CNCLI services by configuring it to run as a docker sidecar container, the sidecar container's built-in healthcheck fails.

Would it be possible to update healthcheck.sh to detect when the container has been started with 'ENTRYPOINT_PROCESS: cncli.sh', and 'command: sync, validate, etc...' and adjust the heathcheck that is performed?

Below is an example docker compose file to illustrate a sidecar config... (The CNCLI sidecar container's entrypoint is overridden by setting env variable: ENTRYPOINT_PROCESS: cncli.sh and command: sync)

services:

#  built-in healthcheck works:
  cardano-node:
    image: cardanocommunity/cardano-node:latest
    volumes:
      - cn-sockets:/opt/cardano/cnode/sockets
      - cn-logs:/opt/cardano/cnode/logs
      - cn-guild-db:/opt/cardano/cnode/guild-db

#  built-in healthcheck fails:
  cardano-cncli-sync:
    image: cardanocommunity/cardano-node:latest
    network_mode: service:cardano-node
    volumes:
      - cn-sockets:/opt/cardano/cnode/sockets
      - cn-logs:/opt/cardano/cnode/logs
      - cn-guild-db:/opt/cardano/cnode/guild-db
    environment:
      ENTRYPOINT_PROCESS: cncli.sh                            # Override entrypoint
    command: sync                                             # Entrypoint command

Thankyou! -Adam

adamsthws avatar Jan 05 '25 19:01 adamsthws