Docker-compose setup healthcheck unhealthy

Hello,

I'm using the example docker-compose file as presented here - with stack version 8.5.2 . I wrapped the docker-compose command into a systemd script. All services were running until today when I had to restart my machine, and it didn't come back up again.

It says container for service "setup" is unhealthy .

when invoking docker-compose w/o the -d flag, i see:

Waiting for Elasticsearch availability
Setting kibana_system password
All done!
setup-1 exited with code 0
container for service "setup" is unhealthy

I then changed the following lines:

    healthcheck:
      #test: ["CMD-SHELL", "[ -f config/certs/es01/es01.crt ]"]
      test: ["CMD-SHELL", "[ -d config/certs/es01/ ]"]

and health check was fine. On my next service restart it did fail again, so I changed back to:

    healthcheck:
      test: ["CMD-SHELL", "[ -f config/certs/es01/es01.crt ]"]
      #test: ["CMD-SHELL", "[ -d config/certs/es01/ ]"]

and the check again passed.

Do you have any idea why I have to change the check command in between restarts ?

any ideas why the health check fails on service restarts?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.