Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to implement health-on-failure via podman-compose #747

Open
tim13kh opened this issue Aug 23, 2023 · 3 comments
Open

Not able to implement health-on-failure via podman-compose #747

tim13kh opened this issue Aug 23, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@tim13kh
Copy link

tim13kh commented Aug 23, 2023

Hello ,

Seems it is not possible to setup option '--health-on-failure' via podman-compose

podman run --replace -d --name test-container --health-cmd /healthcheck --health-on-failure=kill --health-retries=1 health-check-actions

@tim13kh tim13kh added the enhancement New feature or request label Aug 23, 2023
@BlaiseLebreton
Copy link

I think it's mainly due to the fact the compose specificiation doesn't have any way to specify an action when the container is unhealthy

Regardless it would be helpful to have something to automatically restart containers based on their health. Either in the compose file or an external service
On Docker there's the docker-autoheal but it uses the docker socket

@antdking
Copy link
Contributor

As a workaround, I'm running podman-compose with --podman-run-args set:

podman-compose --verbose --podman-run-args='--health-on-failure=restart' up --build -d

This requires that all services have a healthcheck defined, either with a test command, or be explicitly disabled:

service:
  s:
    healthcheck:
      disable: true

@hunter86bg
Copy link

I've proposed a PR#955 that should allow to specify that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants