-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add Dockerfile for discussion #11
base: main
Are you sure you want to change the base?
Conversation
22ff15f
to
112607e
Compare
RUN --mount=type=cache,target=/root/.yarn/berry/cache \ | ||
--mount=type=cache,target=/root/.cache \ | ||
yarn workspaces focus api | ||
# -> why add deps after installing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the @redwoodjs/internal is missing in the api/package.json so 'yarn workspaces focus api' doesn't resolve the nested dependencies of @redwoodjs/core which is 'out of focus' in the root dir.
or dependending how you look at it. the dependency is missing in the @redwoodjs/api-server.
https://github.com/redwoodjs/redwood/blob/main/packages/api-server/package.json
https://github.com/redwoodjs/redwood/blob/main/packages/api-server/src/plugins/lambdaLoader.ts
installing the api-server is definitely not necessary because it's already listed as a dependency in the api/package.json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @xmaxcooking! It seems like a bug on the framework's side if @redwoodjs/api-server
doesn't pull in @redwoodjs/internal
if it actually needs it. Let me see why it needs it and what I can do, because I'd love to avoid pulling internal in here if we can, it's one of the framework's biggest packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. the image without it is ~100MB lighter. revisiting this should be worth the effort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xmaxcooking this should let us remove the need to install it here redwoodjs/redwood#8455
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#10 would also solve this in a much better way, but it's still experimental so we may as well pursue both avenues to reduce size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redwoodjs/redwood#8455 just landed in v5.2.4, so should be possible to try out and see the difference in final image size
I want to use this Dockerfile as a resource for today's discussion. It represents my aggregate learnings from this working group and community.