Skip to content

fix(fonts): self-host Geist so the production build needs no network - #50

Merged
IBJunior merged 1 commit into
mainfrom
fix/local-fonts
Oct 16, 2026
Merged

IBJunior merged 1 commit into
mainfrom
fix/local-fonts

Conversation

@IBJunior

Copy link
Copy Markdown
Member

Why

docker compose --profile full up cannot build the web image. next/font/google downloads Geist from Google Fonts during pnpm build, and inside the Docker build that download fails:

next/font: error:
Failed to fetch `Geist` from Google Fonts.

This also happens on main, independent of #49. A small test build fetched the same URL without problems, so it's not a general network outage, but the production build shouldn't depend on reaching a third party in the first place.

What changed

  • Added the geist package (Vercel's official distribution). It ships the same Geist and Geist Mono variable fonts and loads them through next/font/local.
  • src/app/layout.tsx uses GeistSans / GeistMono from that package. They set the same --font-geist-sans / --font-geist-mono variables that globals.css already reads, so no styling changes.

The fonts are still self-hosted under /_next/static/media, as before. The only difference is that the build no longer fetches them from Google.

Verification

  • pnpm build succeeds locally, and .next/static/media contains the Geist and Geist Mono .woff2 files.
  • docker compose --profile full build web now succeeds; before this change it failed on the font fetch.
  • tsc --noEmit and pnpm test pass.

🤖 Generated with Claude Code

next/font/google downloads Geist from Google Fonts at build time, and that download fails
inside the Docker build, so the production image could not be built at all (on main too).
The `geist` package ships the same variable fonts and loads them with next/font/local under
the same --font-geist-* variables, so the build no longer contacts Google.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@IBJunior
IBJunior merged commit f7be67a into main Oct 16, 2026
1 check passed
@IBJunior
IBJunior deleted the fix/local-fonts branch October 16, 2026 14:58
IBJunior added a commit that referenced this pull request Oct 16, 2026
Brings in the self-hosted Geist fonts (#50) so the production image builds.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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