Skip to content

(feature): docker health checks#12124

Draft
getpwnam wants to merge 1 commit into
inventree:masterfrom
getpwnam:feature/docker-health-checks
Draft

(feature): docker health checks#12124
getpwnam wants to merge 1 commit into
inventree:masterfrom
getpwnam:feature/docker-health-checks

Conversation

@getpwnam

@getpwnam getpwnam commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Add health checks for each container in docker-compose.yml and updated dependencies to require healthy state in each case.

Container Health Check Condition Dependency
inventree-db pg_isready succeeds None
inventree-cache redis-cli ping succeeds None
inventree-server GET to /api/system/health/ returns HTTP 200 inventree-db and inventree-cache must be healthy
inventree-worker is_worker_running() returns True inventree-server must be healthy
inventree-proxy GET to /api/system/health/ with Host: ${INVENTREE_SITE_URL} returns HTTP 200 inventree-server and inventree-worker must be healthy

Tested on my v1.3.3 instance for around 10 days with no problems to report.

Would appreciate some extra testing/validation from a Docker expert.

Refs: #12122
Refs: #12123

@netlify

netlify Bot commented Jun 8, 2026

Copy link
Copy Markdown

Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit f195a89
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6a26bad2b43a2a0008bd25ec

@getpwnam getpwnam changed the title Feature/docker health checks (feature): docker health checks Jun 8, 2026
healthcheck:
test:
[
'CMD-SHELL',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should expose an invoke command to determine the health of the background worker process - which could encapsulate the code her potentially

@SchrodingersGat SchrodingersGat requested a review from matmair June 9, 2026 11:34
@SchrodingersGat SchrodingersGat added docker Docker / docker-compose setup Relates to the InvenTree setup / installation process labels Jun 9, 2026
@SchrodingersGat

Copy link
Copy Markdown
Member

@getpwnam thanks for submitting this, overall it looks pretty reasonable. What are your thoughts about exposing an internal function (e.g. invoke task) for background worker health check? This makes it a bit more general purpose I think.

Also, do you have any tracing or metrics over the 10 day period you have been running this? In particular what load does a 20s interval impose on the setup?

@SchrodingersGat SchrodingersGat added the enhancement This is an suggested enhancement or new feature label Jun 9, 2026
@SchrodingersGat

Copy link
Copy Markdown
Member

Requested Improvements

  • Update the docker documentation to include information about the health checks
  • Add entry to CHANGELOG.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Docker / docker-compose enhancement This is an suggested enhancement or new feature setup Relates to the InvenTree setup / installation process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants