diff --git a/README.md b/README.md index 93d8582c..7e2f9dde 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ and [Bootstrap](http://getbootstrap.com/). An example application is running: -:tv: https://simple-form-bootstrap.herokuapp.com/ +:tv: https://simple-form-bootstrap.onrender.com/ ## License diff --git a/bin/render-build.sh b/bin/render-build.sh new file mode 100755 index 00000000..24b31ca4 --- /dev/null +++ b/bin/render-build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# exit on error +set -o errexit + +bundle install +bundle exec rake assets:precompile +bundle exec rake assets:clean +bundle exec rake db:migrate \ No newline at end of file diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc new file mode 100644 index 00000000..cb765641 --- /dev/null +++ b/config/credentials.yml.enc @@ -0,0 +1 @@ +slDq+IfLVH7AZkZQV7Gl1cQZ3aBz2OTxvEMs1qelgfX4qEoMbaF/giZqAxGj8qAM7U/tHUlz+3ZIBr9gdBDHiOl+pxsrhjVNsUyWvsVjuhMioGqq+RFxdvnW1aEyhHKAW3q1aGd2DYo812QnA3k85K4umI5ilDhxWReNtj775WGmN+Kjef5IMLExxWsZYFXOOstE3RU5Rq61EXwM+x3E0zW2sQDNb1edZyynLbvo7zR4s8ynfMN2Nm7FMnv3ptczWlO1ZgGtFljDtt8TKchy+cYktesgDFSDBuNKF7JM0sexpMWFCMiD/+wcKCC2NPhs+g34twJrWDIpNolZzGOn7nb91/p0MDpplryMnwb9jPAqMgh++AUQwTcmPhdubGiYjulOvBNvfLyDzJ7uNS5LGahsji5jr4Httyac--r//UmqBLvgwwY5rK--taIs1zNkpkVdUmB7cGz2yQ== \ No newline at end of file diff --git a/config/database.yml b/config/database.yml index a606c487..cd2a2dee 100644 --- a/config/database.yml +++ b/config/database.yml @@ -19,3 +19,7 @@ development: test: <<: *default database: db/test.sqlite3 + +production: + <<: *default + url: <%= ENV['DATABASE_URL'] %> \ No newline at end of file diff --git a/config/environments/production.rb b/config/environments/production.rb index 132ee871..5d7c22d6 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -22,7 +22,7 @@ # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? + config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? || ENV['RENDER'].present? # Compress CSS using a preprocessor. # config.assets.css_compressor = :sass diff --git a/config/puma.rb b/config/puma.rb index daaf0369..81dae67c 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -30,14 +30,14 @@ # Workers do not work on JRuby or Windows (both of which do not support # processes). # -# workers ENV.fetch("WEB_CONCURRENCY") { 2 } +workers ENV.fetch("WEB_CONCURRENCY") { 4 } # Use the `preload_app!` method when specifying a `workers` number. # This directive tells Puma to first boot the application and load code # before forking the application. This takes advantage of Copy On Write # process behavior so workers use less memory. # -# preload_app! +preload_app! # Allow puma to be restarted by `bin/rails restart` command. plugin :tmp_restart diff --git a/render.yaml b/render.yaml new file mode 100644 index 00000000..cc2b79f0 --- /dev/null +++ b/render.yaml @@ -0,0 +1,18 @@ +databases: + - name: simple_form_bootstrap + databaseName: simple_form_bootstrap + user: simple_form_bootstrap + +services: + - type: web + name: simple_form_bootstrap + runtime: ruby + buildCommand: "./bin/render-build.sh" + startCommand: "bundle exec puma -C config/puma.rb" + envVars: + - key: DATABASE_URL + fromDatabase: + name: simple_form_bootstrap + property: connectionString + - key: RAILS_MASTER_KEY + sync: false \ No newline at end of file