phusion / passenger-docker

Docker base images for Ruby, Python, Node.js and Meteor web apps
MIT License
2.78k stars 408 forks source link

install nodejs using the nodejs install script for ruby #320

Closed baseballlover723 closed 1 year ago

baseballlover723 commented 3 years ago

I noticed that it was still using node 10.19.0, in the ruby images. This was preventing us from updating some of our node dependencies, since they want a more recent version of node. This PR updates the install script to install node by just running the nodejs install script used in the nodejs image, instead of just installing node via the default apt.

QMiqTx6DHn1bA9yaNaAbsD3CLG8gTmd4 commented 2 years ago

@CamJN Kindly bumping to check this PR. Reported year ago and seems like an easy & small fix.

mathieujobin commented 2 years ago

I am using this method

RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null
RUN echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt install -y --no-install-recommends --no-install-suggests nginx-extras rsyslog libmagickwand-dev imagemagick wkhtmltopdf ghostscript nodejs yarn
RUN sed -i 's/policy\(.*\)"none"\(.*\)PDF/policy\1"read|write"\2PDF/' /etc/ImageMagick-6/policy.xml

RUN node --version
RUN yarn --version
ivailop commented 1 year ago

Node-10 has been EOL for a long time!

Besides that, for Rails 7 with traditional JS bundling, using https://github.com/rails/jsbundling-rails with esbuild it is required to have nodejs>=12:

error esbuild@0.16.16: The engine "node" is incompatible with this module. Expected version ">=12". Got "10.19.0"