From d6325de35c1e73eda0378c22fedb9d15c47b8c1f Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Thu, 3 Aug 2017 14:36:17 +0200 Subject: [PATCH] Add support for RAILS_SERVE_STATIC_FILES to production.rb an use it with Docker --- Dockerfile | 3 ++- config/environments/production.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e88266dd..8ac3b5bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,8 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* && \ apt-get clean -ENV RAILS_ENV=production +ENV RAILS_ENV=production \ + RAILS_SERVE_STATIC_FILES=true WORKDIR /usr/src/app COPY . ./ diff --git a/config/environments/production.rb b/config/environments/production.rb index b68affa4..ce40b7ea 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -20,7 +20,7 @@ Foodsoft::Application.configure do # config.action_dispatch.rack_cache = true # Disable Rails's static asset server (Apache or nginx will already do this). - config.serve_static_files = false + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? # Compress JavaScripts and CSS. config.assets.js_compressor = :uglifier