Skip to content

Instantly share code, notes, and snippets.

@ctrlaltdylan
Created July 20, 2020 13:52
Show Gist options
  • Save ctrlaltdylan/07dd0ef7c665cc76e347bed7db10795d to your computer and use it in GitHub Desktop.
Save ctrlaltdylan/07dd0ef7c665cc76e347bed7db10795d to your computer and use it in GitHub Desktop.
Ruby image with node & yarn
FROM ruby:2.6-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
gnupg \
git \
# substitute 12.x with whichever Node version you require:
&& curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update && apt-get install -y --no-install-recommends \
nodejs \
yarn \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /app
WORKDIR /app
ADD package.json /app/package.json
ADD yarn.lock /app/yarn.lock
RUN yarn --pure-lockfile
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bundle install --jobs 4
ADD . /app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment