Guest User

Untitled

a guest
Jun 6th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. default: &default
  2. adapter: postgresql
  3. encoding: unicode
  4. pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  5.  
  6. development:
  7. <<: *default
  8. database: appname-api_development
  9. username: appname
  10. password: appname
  11. host: <%= ENV['DOCKER_DB_HOST'] || 'localhost' %>
  12.  
  13. test:
  14. <<: *default
  15. database: appname-api_test<%= ENV['TEST_ENV_NUMBER'] %>
  16. username: appname
  17. password: appname
  18. host: <%= ENV['DOCKER_DB_HOST'] || 'localhost' %>
  19.  
  20. root@9176b57db829:/appname# RAILS_ENV=development rake db:drop db:create
  21. Dropped database 'db'
  22. Dropped database 'appname-api_test'
  23. Created database 'db'
  24. Created database 'appname-api_test'
  25.  
  26. version: '2'
  27.  
  28. services:
  29. db:
  30. image: postgres
  31. restart: always
  32. environment:
  33. POSTGRES_USER: appname
  34. POSTGRES_PASSWORD: appname
  35. volumes:
  36. - "${HOME}/.postgres-data:/var/lib/postgresql/data"
  37. redis:
  38. image: redis:3.2
  39. api:
  40. build: .
  41. environment:
  42. DOCKER_DB_HOST: 'db'
  43. REDIS_PROVIDER: 'redis://redis:6379/1'
  44. REDIS_URL: 'redis://redis:6379/1'
  45. SMTP_HOST: 'localhost:3000'
  46. # command: bundle exec rails s -b "0.0.0.0"
  47. volumes:
  48. - "${PWD}:/appname"
  49. ports:
  50. - "3000:3000"
  51. - "4000:4000"
  52. depends_on:
  53. - db
  54. - redis
  55. networks:
  56. default:
  57. aliases:
  58. - api
  59.  
  60. # frozen_string_literal: true
  61. Rails.application.configure do
  62. # Settings specified here will take precedence over those in config/application.rb.
  63.  
  64. # In the development environment your application's code is reloaded on
  65. # every request. This slows down response time but is perfect for development
  66. # since you don't have to restart the web server when you make code changes.
  67. config.cache_classes = false
  68.  
  69. # Do not eager load code on boot.
  70. config.eager_load = false
  71.  
  72. config.action_cable.url = ENV["ACTIONCABLE_URL"]
  73. config.action_cable.allowed_request_origins = [ ENV["FRONTEND_ORIGIN"] ]
  74.  
  75. # Show full error reports.
  76. config.consider_all_requests_local = true
  77.  
  78. # Enable/disable caching. By default caching is disabled.
  79. if Rails.root.join("tmp/caching-dev.txt").exist?
  80. config.action_controller.perform_caching = true
  81.  
  82. config.cache_store = :memory_store
  83. config.public_file_server.headers = {
  84. "Cache-Control" => "public, max-age=172800",
  85. }
  86. else
  87. config.action_controller.perform_caching = false
  88.  
  89. config.cache_store = :null_store
  90. end
  91.  
  92. # Don't care if the mailer can't send.
  93. config.action_mailer.raise_delivery_errors = false
  94.  
  95. config.action_mailer.perform_caching = false
  96.  
  97. config.action_mailer.delivery_method = :letter_opener
  98.  
  99. # Print deprecation notices to the Rails logger.
  100. config.active_support.deprecation = :log
  101.  
  102. # Raise an error on page load if there are pending migrations.
  103. config.active_record.migration_error = :page_load
  104.  
  105. # Debug mode disables concatenation and preprocessing of assets.
  106. # This option may cause significant delays in view rendering with a large
  107. # number of complex assets.
  108. config.assets.debug = true
  109.  
  110. # Suppress logger output for asset requests.
  111. config.assets.quiet = true
  112.  
  113. # Raises error for missing translations
  114. # config.action_view.raise_on_missing_translations = true
  115.  
  116. # Uses Guard and LiveReload to reload html/css changes automatically
  117. config.middleware.insert_after ActionDispatch::Static, Rack::LiveReload
  118. end
Add Comment
Please, Sign In to add comment