Skip to content
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

♻️ Refactor dockerfile and upgrade next #1128 #1308

Merged
merged 2 commits into from
Oct 13, 2022

Conversation

fernandolucchesi
Copy link
Contributor

No description provided.

@fernandolucchesi fernandolucchesi requested a review from a team as a code owner October 12, 2022 13:32
Copy link
Contributor

@nilsml nilsml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't really see how this change will reduce the file size, but seems like the Dockerfile is more tidy! I guess it is the nod_modules. Will test tomorrow on my local PC, and maybe you we can look at the PR together @fernandolucchesi ?

@SvSven
Copy link
Contributor

SvSven commented Oct 13, 2022

We're still installing the dependencies using pnpm, so not sure if this will do anything with the theory that pnpm is the/one of the culprits in the crash loop. I doubt that calling the next build command from yarn, npm, or pnpm makes any difference.

Also this is most likely what reduces the image size so much @nilsml https://nextjs.org/docs/advanced-features/output-file-tracing

Overall it looks a lot cleaner, but I don't have enough experience with docker to spot any potential issues 😅

@fernandolucchesi
Copy link
Contributor Author

I can't really see how this change will reduce the file size, but seems like the Dockerfile is more tidy! I guess it is the nod_modules. Will test tomorrow on my local PC, and maybe you we can look at the PR together @fernandolucchesi ?

the trick is in this new feature by next: https://nextjs.org/docs/advanced-features/output-file-tracing
image

it generates a very optimised built version to run in a container. Then we can disregard the node_modules and a bunch of other files

@fernandolucchesi
Copy link
Contributor Author

fernandolucchesi commented Oct 13, 2022

We're still installing the dependencies using pnpm, so not sure if this will do anything with the theory that pnpm is the/one of the culprits in the crash loop. I doubt that calling the next build command from yarn, npm, or pnpm makes any difference.

Also this is most likely what reduces the image size so much @nilsml https://nextjs.org/docs/advanced-features/output-file-tracing

Overall it looks a lot cleaner, but I don't have enough experience with docker to spot any potential issues 😅

The dockerfile is using 3 "computers" (4 if you count dynatrace...)

deps: uses pnpm to install dependencies
build: doesn't use pnpm
run: doesn't use pnpm

the image is created from the runner container, which doesn't contain pnpm... differently from before where we had pnpm installed during the build and in the exposed image

Copy link
Contributor

@nilsml nilsml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be interesting to test it out. Only deploying the files that are needed should be a good thing, and we may pray to the gods that the crash loops will vanish too.

@fernandolucchesi fernandolucchesi merged commit ed39012 into main Oct 13, 2022
@fernandolucchesi fernandolucchesi deleted the fer/refactor-dockerfile branch January 23, 2023 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants