mageddo / dns-proxy-server

Solve your DNS hosts from your docker containers, then from your local configuration, then from internet
http://mageddo.github.io/dns-proxy-server/
Apache License 2.0
766 stars 76 forks source link

Include wget command in image for healthcheck #331

Open gjrtimmer opened 1 year ago

gjrtimmer commented 1 year ago

What is expected

wget command to be available so healthcheck can be used

What is Happening

wget command not included in image

Changes (Optional)

Please add wget command to image.

docker-compose.yml healthcheck

healthcheck:
    test: wget --no-verbose --tries=1 --no-check-certificate --spider http://localhost:5380
    interval: 10s
    timeout: 10s
    retries: 3
    start_period: 10s
mageddo commented 1 year ago

Hey, it's an DPS acceptance criteria to have a minimal docker image, so add wget to the image will increase its size, I think healthcheck is not a must have, but a nice to have feature unless it's causing some bug, I'm not inclined to add such feature because it will against DPS acceptance criteria.

You are able to create an extended image and configure the healthcheck if you really need it for your use case though.

gunar commented 1 year ago

@gjrtimmer I've been having some success with this:

test: bash -c "exec 5<>/dev/tcp/dps.docker/53"

@mageddo is there any other way you might recommend doing a healthcheck?

mageddo commented 1 year ago

@gunar yeah, it must do the job as you are using dps.docker hostname it means that if you are solving that name then DPS is working and 53 port is listening.

On the future I may consider implement some more complete health and embed it at the container without have to install new commands to the container using some native Linux communication between sh and the process maybe signals, named pipes or even tcp .

Just a draft I've made some tests using your command:

mageddo commented 1 year ago

In the meanwhile I think we should consider to add a command like yours at the healthcheck