From 80c029f78b71c0ae6577cf7ecedd7aaad3ac5500 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 24 Sep 2019 19:53:44 -0300 Subject: [PATCH] =?UTF-8?q?usar=20postgresql=20en=20producci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 3 +-- config/database.yml | 8 ++++++-- monit.conf | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 5d51c5d..2d16973 100644 --- a/Gemfile +++ b/Gemfile @@ -18,8 +18,6 @@ gem 'dotenv-rails', require: 'dotenv/rails-now' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6' -# Use sqlite3 as the database for Active Record -gem 'sqlite3' # Use Puma as the app server gem 'puma', '~> 3.7' # Use SCSS for stylesheets @@ -76,6 +74,7 @@ group :development, :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '~> 2.13' gem 'selenium-webdriver' + gem 'sqlite3' end group :development do diff --git a/config/database.yml b/config/database.yml index f7a3238..28e195b 100644 --- a/config/database.yml +++ b/config/database.yml @@ -21,5 +21,9 @@ test: database: db/test.sqlite3 production: - <<: *default - database: data/production.sqlite3 + adapter: postgresql + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + database: sutty + user: sutty + host: postgresql + encoding: unicode diff --git a/monit.conf b/monit.conf index 9f002db..4d34d69 100644 --- a/monit.conf +++ b/monit.conf @@ -1,5 +1,5 @@ check process sutty with pidfile /srv/http/tmp/puma.pid - start program = "/bin/sh -c 'cd /srv/http && ./bin/migrate_database && foreman start migrate && foreman start sutty'" as uid app + start program = "/bin/sh -c 'cd /srv/http && foreman start migrate && foreman start sutty'" as uid app stop program = "/bin/sh -c 'cat /srv/http/tmp/puma.pid | xargs kill'" check program sync_assets