Skip to content

Commit ca76571

Browse files
authored
fix docker build (#799)
1 parent 29f6768 commit ca76571

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ RUN RAILS_ENV=production \
5454
SECRET_KEY_BASE=dummy \
5555
RAILS_MASTER_KEY=dummy \
5656
DB_ADAPTER=nulldb \
57+
ASSETS_PRECOMPILE=true \
58+
STORAGE_PROVIDER=local \
5759
bundle exec rails assets:precompile
5860

5961
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 \
9799

98100

99101
ENTRYPOINT ["/app/entrypoint.sh"]
100-
CMD ["/usr/bin/supervisord"]
102+
CMD ["/usr/bin/supervisord"]

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ gem 'select2-rails', '~> 4.0.13'
3434

3535
group :production do
3636
# we are using an ExecJS runtime only on the precompilation phase
37-
gem "uglifier", "~> 4.2.0", require: false
37+
gem "terser", "~> 1.2", require: false
3838
end
3939

4040
group :development do

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,15 +455,15 @@ GEM
455455
activesupport (>= 6.1)
456456
sprockets (>= 3.0.0)
457457
stringio (3.1.5)
458+
terser (1.2.5)
459+
execjs (>= 0.3.0, < 3)
458460
thor (1.3.2)
459461
tilt (2.5.0)
460462
timeout (0.4.3)
461463
ttfunk (1.8.0)
462464
bigdecimal (~> 3.1)
463465
tzinfo (2.0.6)
464466
concurrent-ruby (~> 1.0)
465-
uglifier (4.2.1)
466-
execjs (>= 0.3.0, < 3)
467467
unicode-display_width (3.1.4)
468468
unicode-emoji (~> 4.0, >= 4.0.4)
469469
unicode-emoji (4.0.4)
@@ -534,7 +534,7 @@ DEPENDENCIES
534534
sidekiq-cron (~> 1.12.0)
535535
simple_form (~> 5.0.2)
536536
simplecov (~> 0.22)
537-
uglifier (~> 4.2.0)
537+
terser (~> 1.2)
538538
web-console (~> 4.2)
539539

540540
BUNDLED WITH

config/environments/production.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require "active_support/core_ext/integer/time"
22

33
# Uglifier is only used on the precompile phase, so we can require it conditionally
4-
require "uglifier" if ENV["SECRET_KEY_BASE"] == "dummy"
4+
require "terser" if ENV["ASSETS_PRECOMPILE"] == "true"
55

66
Rails.application.configure do
77
# Settings specified here will take precedence over those in config/application.rb.
@@ -28,8 +28,8 @@
2828
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
2929

3030
# Compress CSS & JS using preprocessors only on the precompile phase
31-
if ENV["SECRET_KEY_BASE"] == "dummy"
32-
config.assets.js_compressor = Uglifier.new(harmony: true)
31+
if ENV["ASSETS_PRECOMPILE"] == "true"
32+
config.assets.js_compressor = Terser.new
3333
config.assets.css_compressor = :sass
3434
end
3535

0 commit comments

Comments
 (0)