Skip to content

CheckHealth on Docker #8369

@Crosus97

Description

@Crosus97

Is your feature request related to a problem? Please describe.
I find a "problem" that i cannot check the health of the web service i want to restart the container when the health is bad or had an error

HealthCheck Portainer: Unhealthy
Last output sh: curl: not found

Describe the solution you'd like
Can add the curl in the dockerfile?
this can make this health cheak in the docker compose with the /api/v1/status with the error "401 unautorized"

healthcheck:
test: ["CMD", "sh", "-c", "curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:1337/api/v1/status | grep -qE '401|200'"]
interval: 10s
timeout: 5s
retries: 3
start_period: 60s

Describe alternatives you've considered
I dont know another alternative
i have the deapends on with the mongoDB but this only control th DB not the web services

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions