diff --git a/Dockerfile b/Dockerfile index e16147b8d31..dde813008b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ WORKDIR $APP_HOME COPY Gemfile* .ruby-version ./ RUN bundle install COPY . . +RUN bootsnap precompile --gemfile . RUN rails assets:precompile && rm -fr log @@ -18,6 +19,7 @@ ENV GOVUK_APP_NAME=smart-answers WORKDIR $APP_HOME COPY --from=builder $BUNDLE_PATH $BUNDLE_PATH +COPY --from=builder $BOOTSNAP_CACHE_DIR $BOOTSNAP_CACHE_DIR COPY --from=builder $APP_HOME . USER app diff --git a/Gemfile b/Gemfile index 3cbc4d79062..015a65a0e83 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,7 @@ ruby File.read(".ruby-version").chomp gem "rails", "7.0.4" gem "ast" +gem "bootsnap", require: false gem "gds-api-adapters" gem "gds_zendesk" gem "govspeak" diff --git a/Gemfile.lock b/Gemfile.lock index 393619b2ffe..a3b88b665f8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -75,6 +75,8 @@ GEM rack (>= 0.9.0) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) + bootsnap (1.15.0) + msgpack (~> 1.2) brakeman (5.2.3) builder (3.2.4) byebug (11.1.3) @@ -218,6 +220,7 @@ GEM minitest (>= 4, < 6) mocha (2.0.2) ruby2_keywords (>= 0.0.5) + msgpack (1.6.0) multi_xml (0.6.0) multipart-post (2.1.1) net-imap (0.3.4) @@ -430,6 +433,7 @@ DEPENDENCIES ast better_errors binding_of_caller + bootsnap byebug gds-api-adapters gds_zendesk diff --git a/config/boot.rb b/config/boot.rb index 282011619d9..997563c2aff 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,4 @@ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) require "bundler/setup" # Set up gems listed in the Gemfile. +require "bootsnap/setup"