getkuby / kuby-core

A convention over configuration approach for deploying Rails apps. https://getkuby.io
MIT License
580 stars 26 forks source link

Add a way to disable asset compilation/deployment #96

Open camertron opened 2 years ago

camertron commented 2 years ago

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.

sebastianobar commented 2 years ago

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'

... ...`

camertron commented 1 year ago

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.