Giter VIP home page Giter VIP logo

Comments (6)

rubys avatar rubys commented on September 26, 2024

Does that sound useful to you?

If it is useful to you, lets add it. I might be misunderstanding your app, but I'm not sure what you described will meet your needs.

api_only? is used for two things:

  • removing the assets:precompile step
  • enabling the detection of an api_client_dir.

If I'm understanding your application (correct me if I'm wrong!), you would still want an assets:precompile, but you also have a frontend folder.

Can you describe your frontend folder more? How is it named, how is it built, and where is the build placed, and where should the build ultimately end up?

Using my API only example as an example, the front end folder is named client and is in the same directory as the app, Gemfile, public, etc. It is built using npm run build and produces a client/build directory. This should be copied into public directory of the deployed image.

How close does this match your frontend? What is different? If the pattern is common enough, we might not even need a flag.

from dockerfile-rails.

louim avatar louim commented on September 26, 2024

Hey! The example you describe is pretty close to how our app works. We have an Ember app in a /frontend directory at the root of the project. Compilation happens the same way you describe, and the node js and yarn / npm logic works for us. The only difference is that we do not use rails in api_only mode because we need some of the features from the non api rails middleware.

Forcing the generator by hardcoding

def api_only? 
   true
end

gave me a good enough starting point for our app that I thought it could be useful if other users where in the same situation.

I was thinking something like this:

def api_only?
  Rails.application.config.api_only || options.generate_client?
end

from dockerfile-rails.

rubys avatar rubys commented on September 26, 2024

gave me a good enough starting point

I'm just wondering if I could aim higher than that :-) How does the following look to you?

b3e8646

from dockerfile-rails.

rubys avatar rubys commented on September 26, 2024

I made some more fixes and optimistically pushed out a new gem. When you get a chance, give it a try and see if it works for you or if there is more that can be done.

from dockerfile-rails.

louim avatar louim commented on September 26, 2024

I'll have a look, thanks!

from dockerfile-rails.

rubys avatar rubys commented on September 26, 2024

Optimistically closing this as completed. Feel free to reopen if more needs to be done.

from dockerfile-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.