fix docker build (#799)

This commit is contained in:
Morantron
2025-06-15 15:35:16 +02:00
committed by GitHub
parent 29f6768bb8
commit ca765712d0
4 changed files with 10 additions and 8 deletions

View File

@ -54,6 +54,8 @@ RUN RAILS_ENV=production \
SECRET_KEY_BASE=dummy \
RAILS_MASTER_KEY=dummy \
DB_ADAPTER=nulldb \
ASSETS_PRECOMPILE=true \
STORAGE_PROVIDER=local \
bundle exec rails assets:precompile
RUN mv config/credentials.yml.enc.bak config/credentials.yml.enc 2>/dev/null || true
@ -97,4 +99,4 @@ HEALTHCHECK --interval=1m --timeout=5s --start-period=10s \
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["/usr/bin/supervisord"]
CMD ["/usr/bin/supervisord"]

View File

@ -34,7 +34,7 @@ gem 'select2-rails', '~> 4.0.13'
group :production do
# we are using an ExecJS runtime only on the precompilation phase
gem "uglifier", "~> 4.2.0", require: false
gem "terser", "~> 1.2", require: false
end
group :development do

View File

@ -455,6 +455,8 @@ GEM
activesupport (>= 6.1)
sprockets (>= 3.0.0)
stringio (3.1.5)
terser (1.2.5)
execjs (>= 0.3.0, < 3)
thor (1.3.2)
tilt (2.5.0)
timeout (0.4.3)
@ -462,8 +464,6 @@ GEM
bigdecimal (~> 3.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uglifier (4.2.1)
execjs (>= 0.3.0, < 3)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
@ -534,7 +534,7 @@ DEPENDENCIES
sidekiq-cron (~> 1.12.0)
simple_form (~> 5.0.2)
simplecov (~> 0.22)
uglifier (~> 4.2.0)
terser (~> 1.2)
web-console (~> 4.2)
BUNDLED WITH

View File

@ -1,7 +1,7 @@
require "active_support/core_ext/integer/time"
# Uglifier is only used on the precompile phase, so we can require it conditionally
require "uglifier" if ENV["SECRET_KEY_BASE"] == "dummy"
require "terser" if ENV["ASSETS_PRECOMPILE"] == "true"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
@ -28,8 +28,8 @@ Rails.application.configure do
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
# Compress CSS & JS using preprocessors only on the precompile phase
if ENV["SECRET_KEY_BASE"] == "dummy"
config.assets.js_compressor = Uglifier.new(harmony: true)
if ENV["ASSETS_PRECOMPILE"] == "true"
config.assets.js_compressor = Terser.new
config.assets.css_compressor = :sass
end