-
Notifications
You must be signed in to change notification settings - Fork 1
install node.js in docker container #87
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
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 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,8 +20,13 @@ ENV RATE_LIMIT_WINDOW_MINUTES=1 | |||||||||||||||
|
|
||||||||||||||||
| RUN apt-get update && \ | ||||||||||||||||
| apt-get upgrade -y && \ | ||||||||||||||||
| apt-get install -y curl ffmpeg unzip && \ | ||||||||||||||||
| curl -o- https://fnm.vercel.app/install | bash | ||||||||||||||||
| SHELL ["/bin/bash", "--login", "-c"] | ||||||||||||||||
| RUN fnm install --lts && \ | ||||||||||||||||
|
Comment on lines
+24
to
+26
|
||||||||||||||||
| curl -o- https://fnm.vercel.app/install | bash | |
| SHELL ["/bin/bash", "--login", "-c"] | |
| RUN fnm install --lts && \ | |
| curl -o- https://fnm.vercel.app/install | bash && \ | |
| export PATH="/root/.local/share/fnm:$PATH" && \ | |
| eval "$(fnm env)" && \ | |
| fnm install --lts && \ |
Copilot
AI
Nov 14, 2025
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 fnm installation adds Node.js to the build environment but doesn't ensure it's available in the runtime environment. The fnm tool modifies the shell's PATH through .bashrc, which works with the --login shell, but this doesn't guarantee Node.js will be available when the container runs the CMD.
To ensure Node.js is available at runtime, add:
ENV PATH="/root/.local/share/fnm:$PATH"after the fnm installation, or configure fnm to install Node.js to a permanent location that's added to the PATH environment variable.
Copilot
AI
Nov 14, 2025
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.
[nitpick] Extra trailing whitespace after npm -v. This should be removed for consistency.
| npm -v && \ | |
| npm -v && \ |
Copilot
AI
Nov 14, 2025
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.
Splitting the RUN command into two separate RUN statements creates an additional Docker layer and prevents proper cleanup. The apt-get clean && rm -rf /var/lib/apt/lists/* on line 30 runs in a separate layer from the apt-get install on line 23, so it doesn't actually reduce the image size.
Docker layers are immutable, so removing files in a later layer doesn't remove them from earlier layers. To effectively reduce image size, the installation and cleanup should be in the same RUN command.
Consider combining these RUN commands back together as suggested in the previous comment.
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.
[nitpick] The
unzippackage is added but there's no clear indication in the PR description or code why it's needed. If it's a dependency for fnm or Node.js installation, please document this in a comment. If it's unrelated to the Node.js installation, consider adding it in a separate commit or PR for clarity.