Skip to content

Commit

Permalink
build: update node version doker file
Browse files Browse the repository at this point in the history
  • Loading branch information
tachyons committed Sep 21, 2024
1 parent 6a7af5d commit 2a8e201
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ RUN apt-get update -qq && \
apt-get install -y libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev imagemagick shared-mime-info libvips sudo make cmake netcat libnotify-dev git chromium-driver chromium --fix-missing && apt-get clean

# Setup nodejs and yarn
RUN mkdir -p /etc/apt/keyrings \
RUN 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_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& 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 && apt-get autoremove && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/* \
&& npm install -g yarn

Expand All @@ -48,12 +48,12 @@ RUN if [[ "$OPERATING_SYSTEM" == "linux" ]]; then \
&& chown -R ${NON_ROOT_USERNAME}:${NON_ROOT_GROUPNAME} /home/${NON_ROOT_USERNAME} \
&& chown -R ${NON_ROOT_USERNAME}:${NON_ROOT_GROUPNAME} /home/vendor \
&& chown -R ${NON_ROOT_USERNAME}:${NON_ROOT_GROUPNAME} /home/vendor/bundle \
&& chown -R ${NON_ROOT_USERNAME}:${NON_ROOT_GROUPNAME} /root/.npm \
&& chown -R ${NON_ROOT_USERNAME}:${NON_ROOT_GROUPNAME} /root/.npm \
# Provide sudo permissions to non-root user
&& adduser --disabled-password --gecos '' ${NON_ROOT_USERNAME} sudo \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ;\
fi ; \
fi

# Switch to non-root user
USER ${NON_ROOT_USERNAME}
USER ${NON_ROOT_USERNAME}
4 changes: 2 additions & 2 deletions Dockerfile.production
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG BUILDPLATFORM
ENV NODE_ENV=production
ENV RAILS_ENV=production

RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get update -qq && apt-get install -y --no-install-recommends --auto-remove nodejs imagemagick libvips

RUN npm install --global yarn
Expand Down Expand Up @@ -41,7 +41,7 @@ RUN rm -rf node_modules spec
RUN bundle exec bootsnap precompile --gemfile app/ lib/

# Build stage for the Vue simualtor
FROM --platform=$BUILDPLATFORM node:18.11-slim as simulator_vue_build
FROM --platform=$BUILDPLATFORM node:lts-slim as simulator_vue_build

RUN mkdir -p /public/

Expand Down

0 comments on commit 2a8e201

Please sign in to comment.