-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node engine, package manager and node modules not available in the run image #164
Comments
@musaffa, can you provide some more detail about how your application is being built? What other buildpacks are you using? Can you share build logs with as much context as possible? |
We tried to build a test application which contains the List of buildpacks:
Exported layers:
|
It's because you are running Some buildpacks may not have |
Ah. That is the expected design of the Web Servers buildpack. Its designed to enable serving frontend web applications with a file server like NGINX. The buildpack intentionally omits |
@ryanmoran We are using Fastboot for SSR (Server Side Rendering) of Ember Apps. Instead of just serving files from the dist directory, Fastboot also boots up an Express.js server and sends the rendered HTML contents to the client (browser) for the incoming requests. This dramatically speeds up the initial loading time of modern web apps. SSR is also a must-to-have feature for Search Engine Optimization. For a node server like Express to run, process the incoming requests and send rendered contents, it needs the node engine and node_modules files. SSR is a very common deployment practice for front-end web applications. All the major front-end frameworks, like React, Ember, Angular, Vue and Svelte, have this feature. |
I'm not familiar with Fastboot. I'm gonna play around with it, but just to get a quicker understanding of what is expected to happen within the built container, you will have compiled JS files, an NGINX server that serves them, and That's 2 running processes in the container. Is that right? |
Yes. Fastboot is an Ember addon. It serves both the dist files as well as the rendered HTMLs. NGINX acts as a reverse proxy for the Fastboot server. I'll share a demo app tomorrow. |
That would be super helpful. Thanks! |
@ryanmoran Please check this demo application: https://github.com/musaffa/paketo-ember The README contains the instructions how to build the project with Paketo Buildpacks. You will need Node 18.x and Yarn 1.x. For buildpack specific instructions, check this section. The buildpack build will fail because there's no I checked it with a custom web server buildpack I built locally. There's a caveat though. Once started, the docker process cannot be stopped with 5 files to check out in the repo.
|
@musaffa thank you for the sample repo. I was able to get this working with a few modifications, but I think we need to figure out what the right behavior is here w.r.t. detection. We have a Where I need your help is defining how the Web Servers buildpack would detect that it needs to include the You mention that this is common across all the major front-end frameworks. Do they share common configuration or tooling that we could detect? |
I don't think they share any common configuration and tooling. There's no standard for implementing SSR. |
Since it's been almost 2 year since the last discussion on this issue I want to see if its still an issue. @musaffa is this still something you would be interested in moving forward or has it been too long? |
We are using a hack as mentioned above. This issue hasn't been resolved in this buildpack yet. |
Expected Behavior
Don't delete node engine, package manager and node_modules from launch layers.
Current Behavior
node-run-script
removes node engine, package manager, node_modules from the launch layers. Starting from v0.5,node-run-script
has a default script detection. If there's a script namedbuild
in package.json, this buildpack will be automatically detected. Thus node engine, package manager and node modules will be removed from the launch layers.Possible Solution
The presence of a build script doesn't mean that node engine, package manager and node modules will not be needed in the run image anymore.
node-run-script
should not change the build plan. New env vars can be introduced in order to change the build plan. These env vars can be added to this buildpack or to another buildpack down the layer. Thus developers can choose whether they want to keep node engine, package manager and node modules in the launch layers or not.Steps to Reproduce
build
.Motivations
This issue may affect NodeJs servers and SSR enabled Front-end applications. In my case, it affects FastBoot enabled Ember applications.
The text was updated successfully, but these errors were encountered: