From 29621781d6395d9e6fe45d1ec89942ee824e6f82 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Mon, 27 Mar 2017 21:04:47 +0200 Subject: [PATCH] Add caching of gems [SCI-1096] --- Dockerfile.production | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile.production b/Dockerfile.production index f47aa0598..e29c7e4d3 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -11,6 +11,11 @@ RUN apt-get update -qq && \ sudo libfile-mimeinfo-perl && \ rm -rf /var/lib/apt/lists/* +# install gems +COPY Gemfile* /tmp/ +WORKDIR /tmp +RUN bundle install + # create app directory ENV APP_HOME /usr/src/app RUN mkdir $APP_HOME @@ -19,8 +24,6 @@ COPY . . RUN rm -f $APP_HOME/config/application.yml RUN rm -f $APP_HOME/production.env -RUN bundle install - ENV RAILS_ENV production ENV DATABASE_URL=postgresql://postgres@db/scinote_production RUN bash -c "PAPERCLIP_HASH_SECRET=$(openssl rand -base64 128 | tr -d '\n') SECRET_KEY_BASE=$(openssl rand -hex 64) rake assets:precompile"