Skip to content

Commit c41528d

Browse files
author
Aaron Baker
committed
Render
1 parent 0628116 commit c41528d

4 files changed

Lines changed: 21 additions & 15 deletions

File tree

bin/render-build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
# exit on error
3+
set -o errexit
4+
5+
bundle install
6+
bundle exec rake assets:precompile
7+
bundle exec rake assets:clean
8+
bundle exec rake db:migrate

config/database.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,4 @@ test:
8181
#
8282
production:
8383
<<: *default
84-
database: boca_chondor_react_production
85-
username: boca_chondor_react
86-
password: <%= ENV["BOCA_CHONDOR_REACT_DATABASE_PASSWORD"] %>
84+
url: <%= ENV['DATABASE_URL'] %>

config/environments/production.rb

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

33
Rails.application.configure do
44
# Settings specified here will take precedence over those in config/application.rb.
@@ -22,7 +22,7 @@
2222

2323
# Disable serving static files from the `/public` folder by default since
2424
# Apache or NGINX already handles this.
25-
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
25+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? || ENV['RENDER'].present?
2626

2727
# Compress CSS using a preprocessor.
2828
# config.assets.css_compressor = :sass
@@ -53,7 +53,7 @@
5353
config.log_level = :info
5454

5555
# Prepend all log lines with the following tags.
56-
config.log_tags = [ :request_id ]
56+
config.log_tags = [:request_id]
5757

5858
# Use a different cache store in production.
5959
# config.cache_store = :mem_cache_store
@@ -82,7 +82,7 @@
8282
# require "syslog/logger"
8383
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
8484

85-
if ENV["RAILS_LOG_TO_STDOUT"].present?
85+
if ENV['RAILS_LOG_TO_STDOUT'].present?
8686
logger = ActiveSupport::Logger.new(STDOUT)
8787
logger.formatter = config.log_formatter
8888
config.logger = ActiveSupport::TaggedLogging.new(logger)

config/puma.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,40 @@
44
# the maximum value specified for Puma. Default is set to 5 threads for minimum
55
# and maximum; this matches the default thread size of Active Record.
66
#
7-
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8-
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
7+
max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
8+
min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
99
threads min_threads_count, max_threads_count
1010

1111
# Specifies the `worker_timeout` threshold that Puma will use to wait before
1212
# terminating a worker in development environments.
1313
#
14-
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
14+
worker_timeout 3600 if ENV.fetch('RAILS_ENV', 'development') == 'development'
1515

1616
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
1717
#
18-
port ENV.fetch("PORT") { 3000 }
18+
port ENV.fetch('PORT') { 3000 }
1919

2020
# Specifies the `environment` that Puma will run in.
2121
#
22-
environment ENV.fetch("RAILS_ENV") { "development" }
22+
environment ENV.fetch('RAILS_ENV') { 'development' }
2323

2424
# Specifies the `pidfile` that Puma will use.
25-
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
25+
pidfile ENV.fetch('PIDFILE') { 'tmp/pids/server.pid' }
2626

2727
# Specifies the number of `workers` to boot in clustered mode.
2828
# Workers are forked web server processes. If using threads and workers together
2929
# the concurrency of the application would be max `threads` * `workers`.
3030
# Workers do not work on JRuby or Windows (both of which do not support
3131
# processes).
3232
#
33-
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
33+
workers ENV.fetch('WEB_CONCURRENCY') { 4 }
3434

3535
# Use the `preload_app!` method when specifying a `workers` number.
3636
# This directive tells Puma to first boot the application and load code
3737
# before forking the application. This takes advantage of Copy On Write
3838
# process behavior so workers use less memory.
3939
#
40-
# preload_app!
40+
preload_app!
4141

4242
# Allow puma to be restarted by `bin/rails restart` command.
4343
plugin :tmp_restart

0 commit comments

Comments
 (0)