Improve bundle install [SCI-1199]

This commit is contained in:
Oleksii Kriuchykhin 2017-04-21 15:13:20 +02:00
parent cb22aa47ba
commit 8bf220a972
3 changed files with 10 additions and 12 deletions

View file

@ -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

View file

@ -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

View file

@ -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: