kuby-core icon indicating copy to clipboard operation
kuby-core copied to clipboard

Add a way to disable asset compilation/deployment

Open camertron opened this issue 3 years ago • 2 comments

Some Rails apps don't need asset management (i.e. they're API-only, etc). It would be nice to have a way to disable asset management entirely, perhaps the same way database management is enabled/disabled via the manage_database true/false method.

camertron avatar Mar 14 '22 18:03 camertron

Is it possible to use a workaround to build an api-only rails app? Currently i got this error on build step:

[stage-1 13/13] RUN bundle exec rake assets:precompile #20 sha256:ab9daf939c6d997aebc0d8f7687823b56ac263601fbbce8803989a4fc5c4223f #20 0.908 rake aborted! #20 0.908 Don't know how to build task 'assets:precompile' ... ...

sebastianobar avatar Sep 24 '22 17:09 sebastianobar

Good question @sebastianobar. Yes, you should be able to remove the asset build phase and rails_assets plugin like this:

Kuby.define('my-app') do
  environment(:production) do
    docker do
      delete :assets_phase
    end

    kubernetes do
      plugins.delete :rails_assets
    end
  end
end

That will disable running the asset precompile rake task and prevent Kuby from launching a static asset server.

camertron avatar Sep 24 '22 20:09 camertron