From 6115afca50cd491b29a44dd5ecb3d1760480ed60 Mon Sep 17 00:00:00 2001 From: Dan Elbert Date: Sun, 2 Jun 2019 14:35:15 -0500 Subject: [PATCH] Added beta environment --- Gemfile.lock | 22 +++++----- config/database.yml | 9 ++++ config/environments/beta.rb | 88 +++++++++++++++++++++++++++++++++++++ config/secrets.yml | 3 ++ config/webpacker.yml | 2 + docker-compose-remote.yml | 33 ++++++++++++++ 6 files changed, 145 insertions(+), 12 deletions(-) create mode 100644 config/environments/beta.rb create mode 100644 docker-compose-remote.yml diff --git a/Gemfile.lock b/Gemfile.lock index dfd77cd..2e04cbf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -43,8 +43,8 @@ GEM minitest (~> 5.1) tzinfo (~> 1.1) arel (9.0.0) - bcrypt (3.1.12) - bootsnap (1.4.1) + bcrypt (3.1.13) + bootsnap (1.4.4) msgpack (~> 1.0) builder (3.2.3) coderay (1.1.2) @@ -59,7 +59,7 @@ GEM factory_bot_rails (4.11.1) factory_bot (~> 4.11.1) railties (>= 3.0.0) - ffi (1.10.0) + ffi (1.11.1) formatador (0.2.5) globalid (0.4.2) activesupport (>= 4.2.0) @@ -79,9 +79,8 @@ GEM rspec (>= 2.99.0, < 4.0) i18n (1.6.0) concurrent-ruby (~> 1.0) - jbuilder (2.8.0) + jbuilder (2.9.1) activesupport (>= 4.2.0) - multi_json (>= 1.2) kaminari (1.1.1) activesupport (>= 4.1.0) kaminari-actionview (= 1.1.1) @@ -114,23 +113,22 @@ GEM mini_mime (1.0.1) mini_portile2 (2.4.0) minitest (5.11.3) - msgpack (1.2.9) - multi_json (1.13.1) + msgpack (1.2.10) nenv (0.3.0) nio4r (2.3.1) - nokogiri (1.10.1) + nokogiri (1.10.3) mini_portile2 (~> 2.4.0) notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) - oj (3.7.11) + oj (3.7.12) parslet (1.8.2) pg (1.1.4) pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) puma (3.12.1) - rack (2.0.6) + rack (2.0.7) rack-proxy (0.6.5) rack rack-test (1.1.0) @@ -174,7 +172,7 @@ GEM rspec-mocks (~> 3.8.0) rspec-core (3.8.0) rspec-support (~> 3.8.0) - rspec-expectations (3.8.2) + rspec-expectations (3.8.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.8.0) rspec-mocks (3.8.0) @@ -204,7 +202,7 @@ GEM thread_safe (0.3.6) tzinfo (1.2.5) thread_safe (~> 0.1) - tzinfo-data (1.2018.9) + tzinfo-data (1.2019.1) tzinfo (>= 1.0.0) unitwise (2.2.0) liner (~> 0.2) diff --git a/config/database.yml b/config/database.yml index 1674fe4..4bb45c0 100644 --- a/config/database.yml +++ b/config/database.yml @@ -29,6 +29,15 @@ docker: password: mysecretpassword database: parsley +beta: + adapter: postgresql + pool: 5 + timeout: 5000 + host: postgres + username: parsley + password: <%= ENV['PARSLEY_PG_PASSWORD'] || 'parsley_password' %> + database: beta_parsley + production: adapter: postgresql pool: 5 diff --git a/config/environments/beta.rb b/config/environments/beta.rb new file mode 100644 index 0000000..626e1b6 --- /dev/null +++ b/config/environments/beta.rb @@ -0,0 +1,88 @@ +Rails.application.configure do + # Verifies that versions and hashed value of the package contents in the project's package.json + config.webpacker.check_yarn_integrity = false + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # 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? + + # # Compress JavaScripts and CSS. + # config.assets.js_compressor = :uglifier + # # config.assets.css_compressor = :sass + # + # # Do not fallback to assets pipeline if a precompiled asset is missed. + # config.assets.compile = false + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Mount Action Cable outside main process or domain + # config.action_cable.mount_path = nil + # config.action_cable.url = 'wss://example.com/cable' + # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :info + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment) + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "parsley_#{Rails.env}" + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + # require 'syslog/logger' + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/config/secrets.yml b/config/secrets.yml index a9846fe..18ac709 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -21,5 +21,8 @@ docker: # Do not keep production secrets in the repository, # instead read values from the environment. +beta: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> + production: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/config/webpacker.yml b/config/webpacker.yml index c0538df..913f92a 100644 --- a/config/webpacker.yml +++ b/config/webpacker.yml @@ -98,3 +98,5 @@ production: &production docker: <<: *production +beta: + <<: *production \ No newline at end of file diff --git a/docker-compose-remote.yml b/docker-compose-remote.yml new file mode 100644 index 0000000..70e7467 --- /dev/null +++ b/docker-compose-remote.yml @@ -0,0 +1,33 @@ +version: '3' + +services: + + memcache: + image: memcached:1.5-alpine + command: memcached -m 512 + networks: + - default + + web: + image: registry.elbert.us/parsley:production + restart: unless-stopped + environment: + - RAILS_USE_MEMCACHE=true + - RAILS_LOG_TO_STDOUT=true + - PASSENGER_APP_ENV=beta + - RAILS_ENV=beta + - PARSLEY_PG_PASSWORD=${DB_PASSWORD} + - SECRET_KEY_BASE=${SECRET_KEY_BASE} + links: + - memcache + networks: + - default + - db + - traefik + +networks: + db: + external: true + + traefik: + external: true \ No newline at end of file