From 8bf220a9728cbc1eeeef25656d2c0180e364f2b7 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Fri, 21 Apr 2017 15:13:20 +0200 Subject: [PATCH] Improve bundle install [SCI-1199] --- Dockerfile | 3 +-- Dockerfile.production | 17 ++++++++--------- docker-compose.yml | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index f38b1e707..f5aa00829 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,8 +15,7 @@ RUN apt-get update -qq && \ # heroku tools RUN wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh -ENV BUNDLE_PATH /usr/src/bundle -RUN mkdir $BUNDLE_PATH +ENV BUNDLE_PATH /usr/local/bundle/ # create app directory ENV APP_HOME /usr/src/app diff --git a/Dockerfile.production b/Dockerfile.production index 375cae2e1..5b82281e2 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -12,12 +12,13 @@ RUN apt-get update -qq && \ libfile-mimeinfo-perl && \ rm -rf /var/lib/apt/lists/* +ENV RAILS_ENV production + # install gems -COPY Gemfile* /tmp/ -COPY addons /tmp/addons -WORKDIR /tmp +COPY Gemfile* /usr/src/bundle/ +COPY addons /usr/src/bundle/addons +WORKDIR /usr/src/bundle RUN bundle install -RUN rm -rf addons # create app directory ENV APP_HOME /usr/src/app @@ -26,12 +27,10 @@ WORKDIR $APP_HOME COPY . . RUN rm -f $APP_HOME/config/application.yml $APP_HOME/production.env -ENV RAILS_ENV=production \ - DATABASE_URL=postgresql://postgres@db/scinote_production \ +RUN DATABASE_URL=postgresql://postgres@db/scinote_production \ PAPERCLIP_HASH_SECRET=dummy \ SECRET_KEY_BASE=dummy \ - DEFACE_ENABLED=true - -RUN bash -c "rake assets:precompile && rake deface:precompile" + DEFACE_ENABLED=true \ + bash -c "rake assets:precompile && rake deface:precompile" CMD rails s -b 0.0.0.0 diff --git a/docker-compose.yml b/docker-compose.yml index ed0560df5..bc8894c4a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,7 +26,7 @@ services: - RAILS_ENV=development volumes: - .:/usr/src/app - - scinote_development_bundler:/usr/src/bundle + - scinote_development_bundler:/usr/local/bundle/ - scinote_development_files:/usr/src/app/public/system volumes: