<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Nodebb Healthcheck]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">first we need the check in nodebb/.docker/config</p>
<p dir="auto">vi healtcheck.js</p>
<pre><code>const http = require('http');
const options = {
    host: '127.0.0.1',
    port: 4567,
    timeout: 2000
};

const healthCheck = http.request(options, (res) =&gt; {
    console.log(`HEALTHCHECK STATUS: ${res.statusCode}`);
    if (res.statusCode == 200) {
        process.exit(0);
    }
    else {
        process.exit(1);
    }
});

healthCheck.on('error', function (err) {
    console.error('ERROR');
    process.exit(1);
});

healthCheck.end();
</code></pre>
<p dir="auto">Then we can add the check in our yml File</p>
<pre><code>    healthcheck:
      test: ["CMD", "node", "/opt/config/healthcheck.js"]
      interval: 5s
      timeout: 3s
      retries: 5
      start_period: 15s
</code></pre>
<p dir="auto">To check if everything is Working we can watch docker ps, it should be healthy there or use docker inspeckt</p>
<pre><code>docker inspect --format='{{json .State.Health}}' &lt;container-id&gt;
</code></pre>
<p dir="auto">Greetings</p>
]]></description><link>https://forum.its-egner.de/topic/4581/nodebb-healthcheck</link><generator>RSS for Node</generator><lastBuildDate>Sun, 14 Jun 2026 10:17:02 GMT</lastBuildDate><atom:link href="https://forum.its-egner.de/topic/4581.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 03 Jun 2025 06:42:00 GMT</pubDate><ttl>60</ttl></channel></rss>