質問編集履歴
2
webpacker.yml追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -150,6 +150,107 @@
|
|
150
150
|
|
151
151
|
```
|
152
152
|
|
153
|
+
config/webpacker.yml
|
154
|
+
```
|
155
|
+
# Note: You must restart bin/webpack-dev-server for changes to take effect
|
156
|
+
|
157
|
+
default: &default
|
158
|
+
source_path: app/javascript
|
159
|
+
source_entry_path: packs
|
160
|
+
public_root_path: public
|
161
|
+
public_output_path: packs
|
162
|
+
cache_path: tmp/cache/webpacker
|
163
|
+
check_yarn_integrity: false
|
164
|
+
webpack_compile_output: true
|
165
|
+
|
166
|
+
# Additional paths webpack should lookup modules
|
167
|
+
# ['app/assets', 'engine/foo/app/assets']
|
168
|
+
resolved_paths: []
|
169
|
+
|
170
|
+
# Reload manifest.json on all requests so we reload latest compiled packs
|
171
|
+
cache_manifest: false
|
172
|
+
|
173
|
+
# Extract and emit a css file
|
174
|
+
extract_css: false
|
175
|
+
|
176
|
+
static_assets_extensions:
|
177
|
+
- .jpg
|
178
|
+
- .jpeg
|
179
|
+
- .png
|
180
|
+
- .gif
|
181
|
+
- .tiff
|
182
|
+
- .ico
|
183
|
+
- .svg
|
184
|
+
- .eot
|
185
|
+
- .otf
|
186
|
+
- .ttf
|
187
|
+
- .woff
|
188
|
+
- .woff2
|
189
|
+
|
190
|
+
extensions:
|
191
|
+
- .mjs
|
192
|
+
- .js
|
193
|
+
- .sass
|
194
|
+
- .scss
|
195
|
+
- .css
|
196
|
+
- .module.sass
|
197
|
+
- .module.scss
|
198
|
+
- .module.css
|
199
|
+
- .png
|
200
|
+
- .svg
|
201
|
+
- .gif
|
202
|
+
- .jpeg
|
203
|
+
- .jpg
|
204
|
+
|
205
|
+
development:
|
206
|
+
<<: *default
|
207
|
+
compile: true
|
208
|
+
|
209
|
+
# Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
|
210
|
+
check_yarn_integrity: true
|
211
|
+
|
212
|
+
# Reference: https://webpack.js.org/configuration/dev-server/
|
213
|
+
dev_server:
|
214
|
+
https: false
|
215
|
+
host: localhost
|
216
|
+
port: 3035
|
217
|
+
public: localhost:3035
|
218
|
+
hmr: false
|
219
|
+
# Inline should be set to true if using HMR
|
220
|
+
inline: true
|
221
|
+
overlay: true
|
222
|
+
compress: true
|
223
|
+
disable_host_check: true
|
224
|
+
use_local_ip: false
|
225
|
+
quiet: false
|
226
|
+
pretty: false
|
227
|
+
headers:
|
228
|
+
'Access-Control-Allow-Origin': '*'
|
229
|
+
watch_options:
|
230
|
+
ignored: '**/node_modules/**'
|
231
|
+
|
232
|
+
|
233
|
+
test:
|
234
|
+
<<: *default
|
235
|
+
compile: true
|
236
|
+
|
237
|
+
# Compile test packs to a separate directory
|
238
|
+
public_output_path: packs-test
|
239
|
+
|
240
|
+
production:
|
241
|
+
<<: *default
|
242
|
+
|
243
|
+
# Production depends on precompilation of packs prior to booting for performance.
|
244
|
+
compile: false
|
245
|
+
|
246
|
+
# Extract and emit a css file
|
247
|
+
extract_css: true
|
248
|
+
|
249
|
+
# Cache manifest.json for performance
|
250
|
+
cache_manifest: true
|
251
|
+
|
252
|
+
```
|
253
|
+
|
153
254
|
デプロイは、capiを利用しております。
|
154
255
|
|
155
256
|
もし、お分かりになればご教授いただけませんでしょうか。
|
1
config/environments/production.rb 追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -23,6 +23,133 @@
|
|
23
23
|
= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload'
|
24
24
|
```
|
25
25
|
|
26
|
+
config/environments/production.rb
|
27
|
+
```rb
|
28
|
+
Rails.application.configure do
|
29
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
30
|
+
|
31
|
+
# Code is not reloaded between requests.
|
32
|
+
config.cache_classes = true
|
33
|
+
|
34
|
+
# Eager load code on boot. This eager loads most of Rails and
|
35
|
+
# your application in memory, allowing both threaded web servers
|
36
|
+
# and those relying on copy on write to perform better.
|
37
|
+
# Rake tasks automatically ignore this option for performance.
|
38
|
+
config.eager_load = true
|
39
|
+
|
40
|
+
# Full error reports are disabled and caching is turned on.
|
41
|
+
config.consider_all_requests_local = false
|
42
|
+
config.action_controller.perform_caching = true
|
43
|
+
|
44
|
+
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
|
45
|
+
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
|
46
|
+
# config.require_master_key = true
|
47
|
+
|
48
|
+
# Disable serving static files from the `/public` folder by default since
|
49
|
+
# Apache or NGINX already handles this.
|
50
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
51
|
+
|
52
|
+
# Compress CSS using a preprocessor.
|
53
|
+
# config.assets.css_compressor = :sass
|
54
|
+
|
55
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
56
|
+
config.assets.compile = false
|
57
|
+
|
58
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
59
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
60
|
+
|
61
|
+
# Specifies the header that your server uses for sending files.
|
62
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
63
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
64
|
+
|
65
|
+
# Store uploaded files on the local file system (see config/storage.yml for options).
|
66
|
+
config.active_storage.service = :local
|
67
|
+
|
68
|
+
# Mount Action Cable outside main process or domain.
|
69
|
+
# config.action_cable.mount_path = nil
|
70
|
+
# config.action_cable.url = 'wss://example.com/cable'
|
71
|
+
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http://example.*/ ]
|
72
|
+
|
73
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
74
|
+
# config.force_ssl = true
|
75
|
+
|
76
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
77
|
+
# when problems arise.
|
78
|
+
config.log_level = :debug
|
79
|
+
|
80
|
+
# Prepend all log lines with the following tags.
|
81
|
+
config.log_tags = [ :request_id ]
|
82
|
+
|
83
|
+
# Use a different cache store in production.
|
84
|
+
# config.cache_store = :mem_cache_store
|
85
|
+
|
86
|
+
# Use a real queuing backend for Active Job (and separate queues per environment).
|
87
|
+
# config.active_job.queue_adapter = :resque
|
88
|
+
# config.active_job.queue_name_prefix = "creditcard_com_production"
|
89
|
+
|
90
|
+
config.action_mailer.perform_caching = false
|
91
|
+
|
92
|
+
config.action_mailer.raise_delivery_errors = true
|
93
|
+
config.action_mailer.delivery_method = :smtp
|
94
|
+
config.action_mailer.smtp_settings = {
|
95
|
+
port: 587,
|
96
|
+
address: 'smtp.gmail.com',
|
97
|
+
domain: 'gmail.com',
|
98
|
+
authentication: 'plain',
|
99
|
+
enable_starttls_auto: true
|
100
|
+
}
|
101
|
+
|
102
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
103
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
104
|
+
# config.action_mailer.raise_delivery_errors = false
|
105
|
+
|
106
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
107
|
+
# the I18n.default_locale when a translation cannot be found).
|
108
|
+
config.i18n.fallbacks = true
|
109
|
+
|
110
|
+
# Send deprecation notices to registered listeners.
|
111
|
+
config.active_support.deprecation = :notify
|
112
|
+
|
113
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
114
|
+
config.log_formatter = ::Logger::Formatter.new
|
115
|
+
|
116
|
+
# Use a different logger for distributed setups.
|
117
|
+
# require 'syslog/logger'
|
118
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
119
|
+
|
120
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
121
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
122
|
+
logger.formatter = config.log_formatter
|
123
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
124
|
+
end
|
125
|
+
|
126
|
+
# Do not dump schema after migrations.
|
127
|
+
config.active_record.dump_schema_after_migration = false
|
128
|
+
|
129
|
+
# Inserts middleware to perform automatic connection switching.
|
130
|
+
# The `database_selector` hash is used to pass options to the DatabaseSelector
|
131
|
+
# middleware. The `delay` is used to determine how long to wait after a write
|
132
|
+
# to send a subsequent read to the primary.
|
133
|
+
#
|
134
|
+
# The `database_resolver` class is used by the middleware to determine which
|
135
|
+
# database is appropriate to use based on the time delay.
|
136
|
+
#
|
137
|
+
# The `database_resolver_context` class is used by the middleware to set
|
138
|
+
# timestamps for the last write to the primary. The resolver uses the context
|
139
|
+
# class timestamps to determine how long to wait before reading from the
|
140
|
+
# replica.
|
141
|
+
#
|
142
|
+
# By default Rails will store a last write timestamp in the session. The
|
143
|
+
# DatabaseSelector middleware is designed as such you can define your own
|
144
|
+
# strategy for connection switching and pass that into the middleware through
|
145
|
+
# these configuration options.
|
146
|
+
# config.active_record.database_selector = { delay: 2.seconds }
|
147
|
+
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
|
148
|
+
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
|
149
|
+
end
|
150
|
+
|
151
|
+
```
|
152
|
+
|
26
153
|
デプロイは、capiを利用しております。
|
27
154
|
|
28
155
|
もし、お分かりになればご教授いただけませんでしょうか。
|