This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch docker-up
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/docker-up by this push:
     new 1a8bfca18e Use Node.js for node container healthcheck
1a8bfca18e is described below

commit 1a8bfca18eb6addf1856e051811333b8bb800e68
Author: Maxime Beauchemin <[email protected]>
AuthorDate: Tue Jan 20 16:07:38 2026 +0000

    Use Node.js for node container healthcheck
    
    Replaces /proc/net/tcp parsing with a proper Node.js-based HTTP
    healthcheck similar to Flask's curl-based approach. Uses Node's built-in
    http module to check if webpack dev server is responding.
    
    This is more maintainable and portable than parsing kernel network state.
---
 docker/docker-healthcheck-node.sh | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/docker/docker-healthcheck-node.sh 
b/docker/docker-healthcheck-node.sh
index d8f42b40f2..afb1314407 100755
--- a/docker/docker-healthcheck-node.sh
+++ b/docker/docker-healthcheck-node.sh
@@ -16,5 +16,20 @@
 # limitations under the License.
 #
 
-# Health check for webpack dev server
-curl -f "http://localhost:${WEBPACK_DEVSERVER_PORT:-9000}/"; || exit 1
+# Health check for webpack dev server using Node.js HTTP module
+node -e "
+const http = require('http');
+const req = http.request({
+  hostname: 'localhost',
+  port: ${WEBPACK_DEVSERVER_PORT:-9000},
+  path: '/',
+  method: 'HEAD',
+  timeout: 3000
+}, (res) => {
+  res.resume();
+  process.exit(0);
+});
+req.on('error', () => process.exit(1));
+req.on('timeout', () => { req.destroy(); process.exit(1); });
+req.end();
+" || exit 1

Reply via email to