Repository navigation
fix(docker): drop .next/cache from dashboard image (2.35 GB → 1.06 GB) - #826
Merged
Merged
Conversation
…t in build context
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Dockerfile: removeapps/dashboard/.next/cacheat the end of the build step, so the runner stage no longer copies it..dockerignore: add**/.next, so a host that already ranpnpm builddoesn't send its local.next(about 1.2 GB) as build context.Why
While measuring a fresh self-host install of v1.22.6 (prompted by r/selfhosted feedback about setup and resource use),
docker build .produced a 2.35 GB dashboard image. 1.2 GB of that was.next/cache, webpack's build-time cache, whichnext startdoesn't need. Separately, the first build on a host wherepnpm buildhad already run transferred a 1.25 GB context, because.nextwasn't ignored.Verified (box, Docker 26.1.5)
PORT=3002,API_URLpointing to a local API). These all returned 200:/,/login,/register,/pricing,/sitemap.xml,/docs/self-hosting,/error-tracking/nextjs/server-components-render-error, plus authenticated/dashboard/errors, which rendered ingested errors. No errors in the container log.pnpm install/next buildsteps are unchanged. The runner stage still copies/app(no production-only reinstall, per the v1.17.7 note).Ships with the next patch release. No release is cut here.