Dockerfile Assets

For Rails, Within the docker build command assets precompiled. Assets are copied out of the docker build image and uploaded to s3 for asset serving.

config asset_host

To configure the Rails app to serve the assets from the Jets managed s3 bucket.


Rails.application.configure do
  config.asset_host = ENV['JETS_ASSET_HOST'] if ENV['JETS_ASSET_HOST']

The JETS_ASSET_HOST is automatically set as part of the jets deploy process. It points to either:

  • The Jets s3 Bucket with under the jets/public path where the assets are uploaded to, IE:
  • The Uploads CloudFront CDN which is configured with the Jets S3 Bucket as the Origin. Using CloudFront is recommended. IE:

Disabling Assets Uploading

If for some reason, you want to disable asset serving from S3.


Jets.deploy.configure do
  config.assets.enable = false