質問編集履歴
2
webpacker.yml追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -302,6 +302,208 @@
|
|
302
302
|
|
303
303
|
|
304
304
|
|
305
|
+
config/webpacker.yml
|
306
|
+
|
307
|
+
```
|
308
|
+
|
309
|
+
# Note: You must restart bin/webpack-dev-server for changes to take effect
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
default: &default
|
314
|
+
|
315
|
+
source_path: app/javascript
|
316
|
+
|
317
|
+
source_entry_path: packs
|
318
|
+
|
319
|
+
public_root_path: public
|
320
|
+
|
321
|
+
public_output_path: packs
|
322
|
+
|
323
|
+
cache_path: tmp/cache/webpacker
|
324
|
+
|
325
|
+
check_yarn_integrity: false
|
326
|
+
|
327
|
+
webpack_compile_output: true
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
# Additional paths webpack should lookup modules
|
332
|
+
|
333
|
+
# ['app/assets', 'engine/foo/app/assets']
|
334
|
+
|
335
|
+
resolved_paths: []
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
# Reload manifest.json on all requests so we reload latest compiled packs
|
340
|
+
|
341
|
+
cache_manifest: false
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
# Extract and emit a css file
|
346
|
+
|
347
|
+
extract_css: false
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
static_assets_extensions:
|
352
|
+
|
353
|
+
- .jpg
|
354
|
+
|
355
|
+
- .jpeg
|
356
|
+
|
357
|
+
- .png
|
358
|
+
|
359
|
+
- .gif
|
360
|
+
|
361
|
+
- .tiff
|
362
|
+
|
363
|
+
- .ico
|
364
|
+
|
365
|
+
- .svg
|
366
|
+
|
367
|
+
- .eot
|
368
|
+
|
369
|
+
- .otf
|
370
|
+
|
371
|
+
- .ttf
|
372
|
+
|
373
|
+
- .woff
|
374
|
+
|
375
|
+
- .woff2
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
extensions:
|
380
|
+
|
381
|
+
- .mjs
|
382
|
+
|
383
|
+
- .js
|
384
|
+
|
385
|
+
- .sass
|
386
|
+
|
387
|
+
- .scss
|
388
|
+
|
389
|
+
- .css
|
390
|
+
|
391
|
+
- .module.sass
|
392
|
+
|
393
|
+
- .module.scss
|
394
|
+
|
395
|
+
- .module.css
|
396
|
+
|
397
|
+
- .png
|
398
|
+
|
399
|
+
- .svg
|
400
|
+
|
401
|
+
- .gif
|
402
|
+
|
403
|
+
- .jpeg
|
404
|
+
|
405
|
+
- .jpg
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
development:
|
410
|
+
|
411
|
+
<<: *default
|
412
|
+
|
413
|
+
compile: true
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
# Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
|
418
|
+
|
419
|
+
check_yarn_integrity: true
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
# Reference: https://webpack.js.org/configuration/dev-server/
|
424
|
+
|
425
|
+
dev_server:
|
426
|
+
|
427
|
+
https: false
|
428
|
+
|
429
|
+
host: localhost
|
430
|
+
|
431
|
+
port: 3035
|
432
|
+
|
433
|
+
public: localhost:3035
|
434
|
+
|
435
|
+
hmr: false
|
436
|
+
|
437
|
+
# Inline should be set to true if using HMR
|
438
|
+
|
439
|
+
inline: true
|
440
|
+
|
441
|
+
overlay: true
|
442
|
+
|
443
|
+
compress: true
|
444
|
+
|
445
|
+
disable_host_check: true
|
446
|
+
|
447
|
+
use_local_ip: false
|
448
|
+
|
449
|
+
quiet: false
|
450
|
+
|
451
|
+
pretty: false
|
452
|
+
|
453
|
+
headers:
|
454
|
+
|
455
|
+
'Access-Control-Allow-Origin': '*'
|
456
|
+
|
457
|
+
watch_options:
|
458
|
+
|
459
|
+
ignored: '**/node_modules/**'
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
test:
|
466
|
+
|
467
|
+
<<: *default
|
468
|
+
|
469
|
+
compile: true
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
# Compile test packs to a separate directory
|
474
|
+
|
475
|
+
public_output_path: packs-test
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
production:
|
480
|
+
|
481
|
+
<<: *default
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
# Production depends on precompilation of packs prior to booting for performance.
|
486
|
+
|
487
|
+
compile: false
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
# Extract and emit a css file
|
492
|
+
|
493
|
+
extract_css: true
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
# Cache manifest.json for performance
|
498
|
+
|
499
|
+
cache_manifest: true
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
```
|
504
|
+
|
505
|
+
|
506
|
+
|
305
507
|
デプロイは、capiを利用しております。
|
306
508
|
|
307
509
|
|
1
config/environments/production.rb 追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -48,6 +48,260 @@
|
|
48
48
|
|
49
49
|
|
50
50
|
|
51
|
+
config/environments/production.rb
|
52
|
+
|
53
|
+
```rb
|
54
|
+
|
55
|
+
Rails.application.configure do
|
56
|
+
|
57
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
# Code is not reloaded between requests.
|
62
|
+
|
63
|
+
config.cache_classes = true
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
# Eager load code on boot. This eager loads most of Rails and
|
68
|
+
|
69
|
+
# your application in memory, allowing both threaded web servers
|
70
|
+
|
71
|
+
# and those relying on copy on write to perform better.
|
72
|
+
|
73
|
+
# Rake tasks automatically ignore this option for performance.
|
74
|
+
|
75
|
+
config.eager_load = true
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
# Full error reports are disabled and caching is turned on.
|
80
|
+
|
81
|
+
config.consider_all_requests_local = false
|
82
|
+
|
83
|
+
config.action_controller.perform_caching = true
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
|
88
|
+
|
89
|
+
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
|
90
|
+
|
91
|
+
# config.require_master_key = true
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
# Disable serving static files from the `/public` folder by default since
|
96
|
+
|
97
|
+
# Apache or NGINX already handles this.
|
98
|
+
|
99
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
# Compress CSS using a preprocessor.
|
104
|
+
|
105
|
+
# config.assets.css_compressor = :sass
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
110
|
+
|
111
|
+
config.assets.compile = false
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
116
|
+
|
117
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
# Specifies the header that your server uses for sending files.
|
122
|
+
|
123
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
124
|
+
|
125
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
# Store uploaded files on the local file system (see config/storage.yml for options).
|
130
|
+
|
131
|
+
config.active_storage.service = :local
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
# Mount Action Cable outside main process or domain.
|
136
|
+
|
137
|
+
# config.action_cable.mount_path = nil
|
138
|
+
|
139
|
+
# config.action_cable.url = 'wss://example.com/cable'
|
140
|
+
|
141
|
+
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http://example.*/ ]
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
146
|
+
|
147
|
+
# config.force_ssl = true
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
152
|
+
|
153
|
+
# when problems arise.
|
154
|
+
|
155
|
+
config.log_level = :debug
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
# Prepend all log lines with the following tags.
|
160
|
+
|
161
|
+
config.log_tags = [ :request_id ]
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
# Use a different cache store in production.
|
166
|
+
|
167
|
+
# config.cache_store = :mem_cache_store
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
# Use a real queuing backend for Active Job (and separate queues per environment).
|
172
|
+
|
173
|
+
# config.active_job.queue_adapter = :resque
|
174
|
+
|
175
|
+
# config.active_job.queue_name_prefix = "creditcard_com_production"
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
config.action_mailer.perform_caching = false
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
config.action_mailer.raise_delivery_errors = true
|
184
|
+
|
185
|
+
config.action_mailer.delivery_method = :smtp
|
186
|
+
|
187
|
+
config.action_mailer.smtp_settings = {
|
188
|
+
|
189
|
+
port: 587,
|
190
|
+
|
191
|
+
address: 'smtp.gmail.com',
|
192
|
+
|
193
|
+
domain: 'gmail.com',
|
194
|
+
|
195
|
+
authentication: 'plain',
|
196
|
+
|
197
|
+
enable_starttls_auto: true
|
198
|
+
|
199
|
+
}
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
204
|
+
|
205
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
206
|
+
|
207
|
+
# config.action_mailer.raise_delivery_errors = false
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
212
|
+
|
213
|
+
# the I18n.default_locale when a translation cannot be found).
|
214
|
+
|
215
|
+
config.i18n.fallbacks = true
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
# Send deprecation notices to registered listeners.
|
220
|
+
|
221
|
+
config.active_support.deprecation = :notify
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
226
|
+
|
227
|
+
config.log_formatter = ::Logger::Formatter.new
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
# Use a different logger for distributed setups.
|
232
|
+
|
233
|
+
# require 'syslog/logger'
|
234
|
+
|
235
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
240
|
+
|
241
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
242
|
+
|
243
|
+
logger.formatter = config.log_formatter
|
244
|
+
|
245
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
246
|
+
|
247
|
+
end
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
# Do not dump schema after migrations.
|
252
|
+
|
253
|
+
config.active_record.dump_schema_after_migration = false
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
# Inserts middleware to perform automatic connection switching.
|
258
|
+
|
259
|
+
# The `database_selector` hash is used to pass options to the DatabaseSelector
|
260
|
+
|
261
|
+
# middleware. The `delay` is used to determine how long to wait after a write
|
262
|
+
|
263
|
+
# to send a subsequent read to the primary.
|
264
|
+
|
265
|
+
#
|
266
|
+
|
267
|
+
# The `database_resolver` class is used by the middleware to determine which
|
268
|
+
|
269
|
+
# database is appropriate to use based on the time delay.
|
270
|
+
|
271
|
+
#
|
272
|
+
|
273
|
+
# The `database_resolver_context` class is used by the middleware to set
|
274
|
+
|
275
|
+
# timestamps for the last write to the primary. The resolver uses the context
|
276
|
+
|
277
|
+
# class timestamps to determine how long to wait before reading from the
|
278
|
+
|
279
|
+
# replica.
|
280
|
+
|
281
|
+
#
|
282
|
+
|
283
|
+
# By default Rails will store a last write timestamp in the session. The
|
284
|
+
|
285
|
+
# DatabaseSelector middleware is designed as such you can define your own
|
286
|
+
|
287
|
+
# strategy for connection switching and pass that into the middleware through
|
288
|
+
|
289
|
+
# these configuration options.
|
290
|
+
|
291
|
+
# config.active_record.database_selector = { delay: 2.seconds }
|
292
|
+
|
293
|
+
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
|
294
|
+
|
295
|
+
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
|
296
|
+
|
297
|
+
end
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
```
|
302
|
+
|
303
|
+
|
304
|
+
|
51
305
|
デプロイは、capiを利用しております。
|
52
306
|
|
53
307
|
|