How to run a healthcheck using wget or curl on a grafana/grafana:master image in a container?

Hello. Can please help me with docker-compose grafana healthcheck?
I use an image grafana/grafana:master and the next healthcheck:
healthcheck:
test: ["CMD-SHELL", "wget --quiet --tries=1 --spider [http://localhost:3000/login](http://localhost:3000/login) || exit 1"]
interval: 1s
timeout: 3s
retries: 30

But in logs i got an error lvl=eror msg="Request error" logger=context userId=0 orgId=0 uname= error="Context.HTML:write tcp 127.0.0.1:3000->127.0.0.1:42422: write: broken pipe" because wget returns
wget: can't open 'login': Permission denied

How can I change my healthcheck or install curl via docker-compose file in container, because curl doesn’t install in this image?

https://grafana.com/docs/grafana/v8.5/http_api/other/#returns-health-information-about-grafana

In this case the same error:

/usr/share/grafana $ wget -S [http://localhost:3000/api/health](http://localhost:3000/api/health)
Connecting to localhost:3000 (127.0.0.1:3000)
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=UTF-8
Expires: -1
Pragma: no-cache
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block
Date: Tue, 03 Jan 2023 14:59:29 GMT
Content-Length: 70
Connection: close

wget: can't open 'health': Permission denied

Pretty sure it’s because wget is trying to write the response to the filesystem.

{
  "commit": "21c1d14e91",
  "database": "ok",
  "version": "9.3.2"
}%```
works for me, but
```docker exec -it a1ae99e06144 wget "localhost:3000/api/health"```
gives `wget: can't open 'health': Permission denied`

If the server was denying your request you would see
wget: server returned error: HTTP/1.1 401 Unauthorized

And in logs always present an error, when wget tries to check(((
lvl=eror msg="Request error" logger=context userId=0 orgId=0 uname= error="Context.HTML:write tcp 127.0.0.1:3000->127.0.0.1:42422: write: broken pipe"

I need clean logs without this error

That wget is failing because the CWD isn’t writable for wget to store the response body

Try using wget -O- or -O /tmp/output or something