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:
The public/assets directory is cached across builds by default.
public/assets is mounted at the beginning of the image build process.
rails assets:precompile is executed.
Other steps are executed that are not pertinent.
Files in public/assets are uploaded to a cloud bucket.
public/assets is unmounted.
The directory is no longer available.
The docker image is pushed to the registry.
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.
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:
public/assets
directory is cached across builds by default.public/assets
is mounted at the beginning of the image build process.rails assets:precompile
is executed.public/assets
are uploaded to a cloud bucket.public/assets
is unmounted.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.