[Infra] Next.js 앱 Cloudflare Workers 배포 이전#264
Closed
Yeonny0723 wants to merge 4 commits intodevelopmentfrom
Closed
[Infra] Next.js 앱 Cloudflare Workers 배포 이전#264Yeonny0723 wants to merge 4 commits intodevelopmentfrom
Yeonny0723 wants to merge 4 commits intodevelopmentfrom
Conversation
- wrangler.jsonc: Workers 진입점, compatibility flags(nodejs_compat, global_fetch_strictly_public), 정적 에셋 및 이미지 바인딩 설정 - open-next.config.ts: @opennextjs/cloudflare 어댑터 설정 (Next.js → Workers 변환) - public/_headers: _next/static/* 경로에 1년 immutable 캐시 적용 - .gitignore: .dev.vars(Wrangler 로컬 시크릿 파일) ignore 추가 - next.config.js: 개발 환경에서 Cloudflare 런타임 시뮬레이션 초기화 코드 추가 - package.json: cf:build/preview/deploy/typegen 스크립트 추가, @opennextjs/cloudflare 및 wrangler 의존성 추가, Next.js 14.2.15 → ~15.2.9 업그레이드, --dangerouslyUseUnsupportedNextVersion 플래그 제거
- cookies(): 동기 → 비동기 전환 (layout.tsx, get-server-dictionary.ts) - params: Promise<Params> 타입으로 변경 및 await 처리 (link/[linkDomain]/layout.tsx)
- satori + @resvg/resvg-js(Rust 네이티브 바이너리) 파이프라인 제거 - next/og의 ImageResponse로 교체 (파일시스템 없이 Web API만으로 동작) - 한글 폰트(NotoSansKR)를 fs.readFile 대신 fetch()로 정적 에셋 URL에서 로딩
배포 구조 차이, 설정 파일 역할, Next.js 버전 호환성 이슈, OG 이미지 라우트 마이그레이션 과정 및 보안 검토 내용 포함
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
EC2 + PM2 기반 Node.js standalone 배포를 Cloudflare Workers 기반 Edge 배포로 마이그레이션 합니다.
@opennextjs/cloudflare어댑터를 사용해 Next.js 앱을 Workers 런타임에 맞게 변환했으며,마이그레이션 과정에서 발견된 Next.js 및 Workers 호환성 이슈들을 함께 수정했습니다.
변경 사항
next buildopennextjs-cloudflare buildyarn cf:deploy배포 방법
주요 변경 사항
@opennextjs/cloudflare기반 Next.js Workers 런타임 적용TODO
완료
남은 작업