Skip to content

Add HEALTHCHECK and hadolint - #285

Merged
bndct-devops merged 2 commits into
bndct-devops:mainfrom
llaumgui:docker
Nov 1, 2026
Merged

bndct-devops merged 2 commits into
bndct-devops:mainfrom
llaumgui:docker

Conversation

@llaumgui

Copy link
Copy Markdown
Contributor

Summary

Add curl and HEALTHCHECK feature on Dockerfile.

Add a hadolint test in action to check Dockerfile compliance.

Changes

Backend

  • N/A

Frontend

  • N/A

Screenshots

  • N/A

Checklist

  • [*] pytest passes
  • [*] npm run build clean (frontend typecheck)
  • [*] Manually tested the happy path
  • Docs updated (if user-facing)
  • In-app "Learn more →" link points to the new/updated docs (if docs added)
  • Screenshots added (if UI change)
  • [*] No secrets or credentials committed

Notes

  • N/A

By submitting this PR, I confirm my contributions are licensed under AGPL-3.0.

@bndct-devops

Copy link
Copy Markdown
Owner

@llaumgui Thanks for this. I tested the HEALTHCHECK in a container and it comes back unhealthy on a healthy server. It's in exec form, so there's no shell: the |, grep and || get passed to curl as URLs and it exits 3 with "Could not resolve host: |". That would flag every Tome container as unhealthy. The Docker job doesn't run on PRs, so CI couldn't catch it.

The grep isn't needed anyway, curl -f already fails on anything but a 2xx and the endpoint can only answer ok. I'd also rather not add curl to the image just for this, python is already there. This works (tested):

HEALTHCHECK --interval=30s --timeout=5s --start-period=20s
CMD python -c "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8080/api/health', timeout=4).status == 200 else 1)"

If you update the PR to that and drop the curl install, I'll merge it.

On hadolint I'll pass. With six rules ignored it doesn't tell us much, and I don't want another gate in front of the image build on main.

@llaumgui

llaumgui commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Sorry for the mistake, I got confused between my local tests and some fixes I applied afterward.

Regarding curl vs Python, the image size difference is indeed negligible, but I figured curl would be more performant and use fewer resources than launching a Python process for a health check.

I have removed Hadolint from GitHub Actions, but left the .hadolint.yaml file with fewer exclusions. If you use the Hadolint plugin in VS Code (for example), you will still be able to view issues.

@bndct-devops

Copy link
Copy Markdown
Owner

Looks good, tested the new probe against the 2.8.0 image and it behaves correctly (0 on ok, 1 on no port and on 404). Merging this and #287, thanks for compromising on the changes! 👍

@bndct-devops
bndct-devops merged commit 3b5202c into bndct-devops:main Nov 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants