Skip to content

fix(docker): drop .next/cache from dashboard image (2.35 GB → 1.06 GB) - #826

Merged
unjica merged 1 commit into
developfrom
fix/dashboard-image-size
Oct 19, 2026
Merged

unjica merged 1 commit into
developfrom
fix/dashboard-image-size

Conversation

@unjica

@unjica unjica commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

What

  • Dockerfile: remove apps/dashboard/.next/cache at the end of the build step, so the runner stage no longer copies it.
  • .dockerignore: add **/.next, so a host that already ran pnpm build doesn'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, which next start doesn't need. Separately, the first build on a host where pnpm build had already run transferred a 1.25 GB context, because .next wasn't ignored.

Verified (box, Docker 26.1.5)

  • Built both images from a clean context: before 2.35 GB, after 1.06 GB.
  • Ran the new image (PORT=3002, API_URL pointing 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 build steps 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.

@unjica
unjica merged commit b2919ce into develop Oct 19, 2026
7 checks passed
@unjica
unjica deleted the fix/dashboard-image-size branch October 19, 2026 09:37
@unjica unjica mentioned this pull request Oct 19, 2026
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.

1 participant