Skip to content

Commit

Permalink
Update Dockerfile_local to rebuild faster
Browse files Browse the repository at this point in the history
This makes it so that cached layers can be used when all that is
changing is VMPooler's code, and not its gems.
  • Loading branch information
genebean committed Oct 27, 2021
1 parent 069c12d commit ea48cd3
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions docker/Dockerfile_local
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

FROM jruby:9.2-jdk

COPY docker/docker-entrypoint.sh /usr/local/bin/
COPY ./ ./

ENV RACK_ENV=production

RUN apt-get update -qq && \
Expand All @@ -21,9 +18,18 @@ RUN apt-get update -qq && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*

COPY docker/docker-entrypoint.sh /usr/local/bin/
COPY ./Gemfile* ./
COPY ./vmpooler.gemspec ./
COPY ./lib/vmpooler/version.rb ./lib/vmpooler/version.rb

RUN gem install bundler && \
bundle install && \
gem build vmpooler.gemspec && \
bundle config set --local jobs 3 && \
bundle install

COPY ./ ./

RUN gem build vmpooler.gemspec && \
gem install vmpooler*.gem && \
chmod +x /usr/local/bin/docker-entrypoint.sh

Expand Down

0 comments on commit ea48cd3

Please sign in to comment.