FROM ruby:2.7
RUN apt-get update -yqq
RUN apt-get install -yqq nodejs npm
RUN node -v
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -y
RUN apt-get install yarn -y
RUN gem install bundler:'~> 2.1.4'
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN bundle install
RUN bin/rails webpacker:install