-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(docker): use Debian-provided Node.js instead of NodeSource #518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,17 +39,13 @@ FROM python:3.11-slim | |
| # Set working directory | ||
| WORKDIR /app | ||
|
|
||
| # Install Node.js and npm | ||
| # Install Node.js and npm from Debian repos (avoids NodeSource TLS issues) | ||
| RUN apt-get update && apt-get install -y \ | ||
| curl \ | ||
| gnupg \ | ||
| git \ | ||
| ca-certificates \ | ||
| && mkdir -p /etc/apt/keyrings \ | ||
| && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ | ||
| && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \ | ||
| && apt-get update \ | ||
| && apt-get install -y nodejs \ | ||
| nodejs \ | ||
| npm \ | ||
|
Comment on lines
+47
to
+48
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description states that
python:3.11-slimis based on Debian Trixie, but it is currently based on Debian 12 (Bookworm). Consequently,apt-get install nodejswill install Node.js v18, not v20. Since the build stage (node_builder) uses Node.js v20 and thepackage.jsonspecifies@types/node": "^20", this version mismatch between build and runtime environments could lead to unexpected behavior or runtime errors. If Node.js 20 is strictly required, you may need to use a different installation method or a base image that supports it natively.