rails / propshaft

Deliver assets for Rails
MIT License
913 stars 97 forks source link

Add support to override manifest_path as a configuration #195

Closed fabiormoura closed 1 month ago

fabiormoura commented 4 months ago

What is the problem this is solving?

The current implementation has a hardcoded manifest path making it difficult to adapt to various deployment scenarios.

In my scenario, a Docker image needs to be be built for the application to be deployed. The build process works as follows:

When the docker container is started in a production environment, the public/assets folder does not exist in the local path as all the files are served through the CDN. This causes Propshaft to use the Dynamic resolver, which needs to compute all asset digests at runtime.

The code changes prevents Propshaft from using the Dynamic resolver and allows the Static resolver to be used even if public/assets is absent in the local path which is ideal for setups where assets are served via CDN.