Skip to content

fix docker build #799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -97,4 +99,4 @@ HEALTHCHECK --interval=1m --timeout=5s --start-period=10s \


ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["/usr/bin/supervisord"]
CMD ["/usr/bin/supervisord"]
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,15 @@ 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)
ttfunk (1.8.0)
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)
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -28,8 +28,8 @@
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

Expand Down