Skip to content

Instantly share code, notes, and snippets.

@ngw
Created October 8, 2018 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngw/0078840bc8136e1cd9e823982b1c0d9e to your computer and use it in GitHub Desktop.
Save ngw/0078840bc8136e1cd9e823982b1c0d9e to your computer and use it in GitHub Desktop.
FROM ruby:2.5.1
RUN apt-get update && apt-get install -qq -y build-essential libpq-dev postgresql-client \
curl apt-utils apt-transport-https imagemagick --fix-missing --no-install-recommends
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
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 && apt-get install -y nodejs yarn
RUN bundle config --global frozen 1
# Cache gems
WORKDIR /tmp
ADD Gemfile .
ADD Gemfile.lock .
RUN gem install bundler
RUN bundle install --jobs 4
WORKDIR /usr/src/directory
ADD . /usr/src/directory
RUN yarn install
RUN bundle exec rake assets:precompile
CMD bundle exec rake db:migrate && bundle exec rails s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment