Skip to content

Commit

Permalink
need assets inside of docker too
Browse files Browse the repository at this point in the history
have to run in prod mode to get minification
  • Loading branch information
grosser committed Nov 7, 2016
1 parent e27ef15 commit d55d4eb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.1.0
v6.1.0
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ COPY config /app/config
COPY app /app/app
COPY lib /app/lib

# Assets
RUN echo "takes 5 minute" && RAILS_ENV=production PRECOMPILE=1 bundle exec rake assets:precompile

EXPOSE 9080

CMD ["bundle", "exec", "puma", "-C", "./config/puma.rb"]
3 changes: 3 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
# Suppress logger output for asset requests.
config.assets.quiet = true

# docker ships with precompiled assets, but we want dynamic assets in development
config.assets.prefix = "/assets_dev"

BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP']

# Use an evented file watcher to asynchronously detect changes in source code,
Expand Down
4 changes: 2 additions & 2 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

config.public_file_server.enabled = true

# Compress JavaScripts and CSS.
# Compress JavaScripts and CSS ... about 3 minutes each
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
config.assets.css_compressor = :sass

# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
Expand Down

0 comments on commit d55d4eb

Please sign in to comment.