Nodebb Healthcheck
-
Hi,
first we need the check in nodebb/.docker/config
vi healtcheck.js
const http = require('http'); const options = { host: '127.0.0.1', port: 4567, timeout: 2000 }; const healthCheck = http.request(options, (res) => { 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();Then we can add the check in our yml File
healthcheck: test: ["CMD", "node", "/opt/config/healthcheck.js"] interval: 5s timeout: 3s retries: 5 start_period: 15sTo check if everything is Working we can watch docker ps, it should be healthy there or use docker inspeckt
docker inspect --format='{{json .State.Health}}' <container-id>Greetings
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login