From 9c11b2c6b9b31205ef850420cdc0d8f1e0f471a3 Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 25 Nov 2024 15:05:05 +0000 Subject: [PATCH] don't init rails performance during asset compilation --- config/initializers/rails_performance.rb | 2 +- docker/build.dockerfile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/initializers/rails_performance.rb b/config/initializers/rails_performance.rb index c1200d576..2ecb997b8 100644 --- a/config/initializers/rails_performance.rb +++ b/config/initializers/rails_performance.rb @@ -1,4 +1,4 @@ -if defined?(RailsPerformance) && !Rails.env.test? +if defined?(RailsPerformance) && !Rails.env.test? && ENV["RAILS_ASSETS_PRECOMPILE"].blank? RailsPerformance.setup do |config| config.redis = Redis::Namespace.new("#{Rails.env}-rails-performance", redis: Redis.new) config.duration = 4.hours diff --git a/docker/build.dockerfile b/docker/build.dockerfile index baeb80f5c..a6d0a1efa 100644 --- a/docker/build.dockerfile +++ b/docker/build.dockerfile @@ -27,4 +27,5 @@ RUN \ DATABASE_URL="nulldb://user:pass@localhost/db" \ SECRET_KEY_BASE="placeholder" \ RACK_ENV="production" \ + RAILS_ASSETS_PRECOMPILE=1 \ bundle exec rake assets:precompile