Comments (6)
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.
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.
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?
from dockerfile-rails.
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.
I'll have a look, thanks!
from dockerfile-rails.
Optimistically closing this as completed. Feel free to reopen if more needs to be done.
from dockerfile-rails.
Related Issues (20)
- Change default ports when Thruster is present HOT 1
- Allow to add custom ignores to .dockerignore HOT 1
- Resync with rails 7.2.0 beta
- Ruby 3.3.3 issue: net-pop HOT 2
- Remove node_modules when no node runtime is installed in the image ? HOT 5
- Precompile with defer, invalid Dockerfile
- chown: cannot access 'storage': No such file or directory HOT 2
- `packages` directive on `dockerfile.yaml` doesn't install all packages
- replace frozen-lockfile with immutable for yarn >= 2
- [REQ] Is there a plan to support Alpine Linux in `dockerfile-rails` instead of the Debian OS? HOT 7
- Node being installed even if Bun is being used HOT 2
- Error installing psych (5.1.2) when creating DockerFile with Rails 7.1.2
- Order of `COPY` commands doesn't allow for Gemfile's `file` directive
- Node path not found error when building image with Alpine
- Missing RUN statement when using execjs and Yarn HOT 1
- Latest Rubygems no longer supports Ruby < 3 HOT 1
- Use `bun` official images HOT 2
- Ignore Shrine default upload directory in .dockerignore
- Support Litefs database migrations with multiple machines in primary
- The app scanner for ActionCable should check if the config needs Redis HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dockerfile-rails.