Skip to content

Update Dockerfile entrypoint to use node directly#1384

Merged
qtomlinson merged 1 commit intoclearlydefined:masterfrom
qtomlinson:qt/mod_dockerfile
Dec 18, 2025
Merged

Update Dockerfile entrypoint to use node directly#1384
qtomlinson merged 1 commit intoclearlydefined:masterfrom
qtomlinson:qt/mod_dockerfile

Conversation

@qtomlinson
Copy link
Copy Markdown
Collaborator

@qtomlinson qtomlinson commented Dec 17, 2025

Overview
This PR improves Docker container behavior by replacing the npm-based entrypoint with direct Node.js execution, enabling proper signal handling and graceful container shutdown.

Background:
the server fails to start with the following error:

2025-12-17T06:31:53.7248178Z npm ERR! path /opt/service
2025-12-17T06:31:53.7249081Z npm ERR! command failed
2025-12-17T06:31:53.7251978Z npm ERR! signal SIGTERM
2025-12-17T06:31:53.7254913Z npm ERR! command sh -c "node --max-old-space-size=8192 ./bin/www"
2025-12-17T06:31:53.7336171Z npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2025-12-17T06_28_02_218Z-debug-0.log

The issue is likely caused by the memory allocation setting: the process is requesting 8GB, which exceeds the 7GB provisioned on our dev App Service Plan. This is a known issue tracked at #1256.

Key Changes:

  • Entrypoint Update
  • Memory Configuration: Added ENV NODE_OPTIONS="--max-old-space-size=8192" for configurable memory allocation. We can potentially set this to a lower value on dev deployment.

@qtomlinson qtomlinson marked this pull request as ready for review December 17, 2025 22:09
Copy link
Copy Markdown
Contributor

@ryanbrandenburg ryanbrandenburg left a comment

Choose a reason for hiding this comment

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

This looks like a good near-term fix, though I wonder what the long-term objects being retained are.

@qtomlinson
Copy link
Copy Markdown
Collaborator Author

@ryanbrandenburg Thank you for the feedback. This PR provides a short‑term measure to get the service running, and it also introduces two improvements:

  • Running the app with node directly (instead of npm start or a wrapper) ensures signals like SIGTERM/SIGINT reach the process, enabling graceful shutdown.
  • NODE_OPTIONS is the official Node.js runtime configuration mechanism; it lets you adjust settings (e.g., --max-old-space-size) without code changes or rebuilds.

@qtomlinson qtomlinson merged commit 6acea02 into clearlydefined:master Dec 18, 2025
4 checks passed
@qtomlinson qtomlinson deleted the qt/mod_dockerfile branch December 18, 2025 16:21
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.

3 participants