Add caching of gems [SCI-1096]

This commit is contained in:
Oleksii Kriuchykhin 2017-03-27 21:04:47 +02:00
parent a7be37ef67
commit 29621781d6

View file

@ -11,6 +11,11 @@ RUN apt-get update -qq && \
sudo libfile-mimeinfo-perl && \ sudo libfile-mimeinfo-perl && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# install gems
COPY Gemfile* /tmp/
WORKDIR /tmp
RUN bundle install
# create app directory # create app directory
ENV APP_HOME /usr/src/app ENV APP_HOME /usr/src/app
RUN mkdir $APP_HOME RUN mkdir $APP_HOME
@ -19,8 +24,6 @@ COPY . .
RUN rm -f $APP_HOME/config/application.yml RUN rm -f $APP_HOME/config/application.yml
RUN rm -f $APP_HOME/production.env RUN rm -f $APP_HOME/production.env
RUN bundle install
ENV RAILS_ENV production ENV RAILS_ENV production
ENV DATABASE_URL=postgresql://postgres@db/scinote_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" RUN bash -c "PAPERCLIP_HASH_SECRET=$(openssl rand -base64 128 | tr -d '\n') SECRET_KEY_BASE=$(openssl rand -hex 64) rake assets:precompile"