brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Nginx Proxy Manager has a health check, you just have to switch it on

Docker
~/tips/tip-nginxproxymanager-healthcheck

healthcheck:

Adds a Docker health check so Nginx Proxy Manager shows healthy or unhealthy in docker ps.

Run docker ps and NPM never says healthy or unhealthy. That is no bug. The image ships without a HEALTHCHECK.

The docs give an opt-in version for your compose file:

healthcheck:
  test: ["CMD", "/usr/bin/check-health"]
  interval: 10s
  timeout: 3s

The script /usr/bin/check-health is inside the image already. After a recreate, docker ps shows (healthy) next to the container once the check passes, and other tools that watch container health have something to read.

A monitoring tool or a restart policy that depends on health has nothing to go on without it. Docker restarts a container that exits, but not one that is up and broken, and it does nothing about an unhealthy one on its own, so pair the check with whatever alerts you. Caveat: ten seconds is the docs’ value. If your box is slow at boot, you may see a short unhealthy period right after a restart, which is normal.

Docker only reports the state. Acting on it takes a separate tool or an alert.

Further reading: Nginx Proxy Manager: Advanced Configuration, On this site: pin the Nginx Proxy Manager image version, upgrade on purpose, On this site: DISABLE_IPV6 fixes the "Address family not supported" error in Nginx Proxy Manager, On this site: Guide: put Nextcloud behind Nginx Proxy Manager with HTTPS and the right headers

Going deeper: Guide: fix a 502 Bad Gateway in Nginx Proxy Manager, with a checklist that finds the cause

More Docker tips ONBUILD RUN /usr/local/bin/python-build --dir /app/src SHELL ["/bin/bash", "-c"] docker commit <container> myname/testimage:version3 docker import /path/to/exampleimage.tgz docker compose events All Docker tips (192) All topics

Link