Skip to content

Commit

Permalink
Cache gems in docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
bellkev committed Jan 6, 2015
1 parent a4868aa commit d4cc490
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ RUN rm -rf /etc/service/sshd /etc/my_init.d/00_regen_ssh_host_keys.sh
RUN apt-get update
RUN apt-get install sqlite3 libsqlite3-dev

# Copy in app and config files
ADD nginx/rails-env.conf /etc/nginx/main.d/rails-env.conf
ADD nginx/webapp.conf /etc/nginx/sites-enabled/webapp.conf
ADD . /home/app/webapp

# Install gems
# Install gems--do this early to avoid cache invalidation
ADD Gemfile* /home/app/webapp/
WORKDIR /home/app/webapp
RUN bundle install

# Copy in app and config files
ADD nginx/rails-env.conf /etc/nginx/main.d/
ADD nginx/webapp.conf /etc/nginx/sites-enabled/
ADD . /home/app/webapp

# Install "production" database (for demo purposes only)
WORKDIR /home/app/webapp
RUN RAILS_ENV=production rake db:migrate
Expand Down

0 comments on commit d4cc490

Please sign in to comment.