Skip to content

Commit

Permalink
update dockerfiles to install node via apt-get
Browse files Browse the repository at this point in the history
  • Loading branch information
onshi committed Aug 26, 2024
1 parent 97474ac commit 393b003
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
14 changes: 5 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
ARG RUBY_VERSION=3.3.4
FROM ruby:${RUBY_VERSION}

ARG NODE_VERSION=v22.6.0
ARG NODE_VERSION=22
ARG YARN_VERSION=1.22.22

RUN curl -fsSL https://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION-linux-x64.tar.gz \
-o /tmp/node-$NODE_VERSION-linux-x64.tar.gz \
&& tar -xzvf /tmp/node-$NODE_VERSION-linux-x64.tar.gz -C /usr/local \
&& rm -rf /tmp/node-$NODE_VERSION-linux-x64.tar.gz

ENV PATH=/usr/local/node-$NODE_VERSION-linux-x64/bin:$PATH

RUN npm install -g yarn@$YARN_VERSION
RUN curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \
&& apt-get update \
&& apt-get install --yes --no-install-recommends nodejs \
&& npm install -g yarn@$YARN_VERSION

ARG RAILS_VERSION
# Install Rails based on the version specified but if not specified, install the latest version.
Expand Down
14 changes: 5 additions & 9 deletions Dockerfile.unix
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@ ARG USER_ID=1000
ARG GROUP_ID=1000
RUN groupadd -g $GROUP_ID app && useradd -u $USER_ID -g app -m app

ARG NODE_VERSION=v22.6.0
ARG NODE_VERSION=22
ARG YARN_VERSION=1.22.22

RUN curl -fsSL https://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION-linux-x64.tar.gz \
-o /tmp/node-$NODE_VERSION-linux-x64.tar.gz \
&& tar -xzvf /tmp/node-$NODE_VERSION-linux-x64.tar.gz -C /usr/local \
&& rm -rf /tmp/node-$NODE_VERSION-linux-x64.tar.gz

ENV PATH=/usr/local/node-$NODE_VERSION-linux-x64/bin:$PATH

RUN npm install -g yarn@$YARN_VERSION
RUN curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \
&& apt-get update \
&& apt-get install --yes --no-install-recommends nodejs \
&& npm install -g yarn@$YARN_VERSION

USER app

Expand Down

0 comments on commit 393b003

Please sign in to comment.