-
Notifications
You must be signed in to change notification settings - Fork 0
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
[25.01.05 / TASK-91] Feature - deploy 세팅 #8
Conversation
Walkthrough이 풀 리퀘스트는 Velog Dashboard V2 프론트엔드 프로젝트의 Docker 배포 및 빌드 프로세스를 자동화하기 위한 여러 구성 파일을 추가하고 수정했습니다. GitHub Actions 워크플로우, Dockerfile, 생태계 구성, Next.js 설정 등이 포함되어 있으며, 애플리케이션의 빌드, 이미지 생성, 배포 프로세스를 간소화하는 데 중점을 두고 있습니다. Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Nitpick comments (3)
Dockerfile (1)
19-21
: PM2 런타임 사용
PM2를 통해 프로세스 관리가 용이해지고, 재시작 등이 자동화됩니다. 다만, 단순 환경에서는npm start
와 큰 차이가 없을 수 있으니 운영 환경 별로 요구 사항을 고려해 보시면 좋겠습니다.readme.md (1)
22-39
: 로컬 환경 Docker 활용 안내 추가
Docker 이미지를 빌드, 태깅, 푸시, 테스트하는 과정을 친절하게 정리하셨습니다. 협업자 및 사용자가 로컬 개발-운영 단계를 빠르게 파악할 수 있어 좋습니다. 추가적으로 private registry 사용 시 유의사항, .env 구성 시 민감 정보 의존성 등에 대한 간단한 주석을 달아주시면 더 완벽한 가이드가 될 것 같습니다..gitignore (1)
1-3
: 환경 변수 파일 무시 패턴을 최적화하세요현재 환경 변수 파일에 대한 무시 패턴이 중복되어 있습니다. 상단의
.env.*
와 하단의 개별.env
파일 패턴이 중복됩니다.다음과 같이 패턴을 단순화하는 것을 추천드립니다:
# CUSTOM -.env.* +.env* !.env.sample # dotenv environment variable files -.env -.env.development.local -.env.test.local -.env.production.local -.env.localAlso applies to: 162-168
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (8)
.github/workflows/docker-publish.yaml
(1 hunks).gitignore
(3 hunks)Dockerfile
(1 hunks)ecosystem.config.js
(1 hunks)next.config.mjs
(1 hunks)package.json
(1 hunks)readme.md
(1 hunks)src/app/(with-tracker)/(login)/Content.tsx
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- ecosystem.config.js
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/docker-publish.yaml
15-15: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
18-18: the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
33-33: the runner of "docker/login-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🔇 Additional comments (7)
next.config.mjs (2)
4-4
: React 스트릭트 모드 활성화
리액트 애플리케이션에서 잠재 버그와 비정상 동작을 조기에 탐지할 수 있어 유용합니다. 개발 중에는 일부 메모리 사용량이 증가하거나 경고가 추가될 수 있으므로, 해당 사항을 인지하고 운영 환경에서의 영향도를 주시해 주세요.
6-6
: Standalone 출력 옵션 활성화
Docker 환경 등에서 독립 실행형으로 앱을 배포하기에 적합한 설정입니다. 빌드된 산출물이 self-contained 형태로 제공되므로, 배포/호스팅 방식을 단순화할 수 있습니다.src/app/(with-tracker)/(login)/Content.tsx (1)
22-22
: react-hook-form의 검증 모드 변경
mode: 'all'
로 설정 시, 모든 입력 이벤트에서 즉시 검증이 이루어져 사용성이 향상될 수 있습니다. 다만, 사용자가 빠르게 입력할 때 간헐적으로 잦은 검증이 부담이 되지 않을지 고려 바랍니다.Dockerfile (3)
1-5
: Node 버전 고정 및 추가 패키지 설치 확인
Node 23 버전을 사용하고 있는데, 특정 기능·보안 이슈를 확인하려면 버전 고정이 필수적일 수 있습니다. 또한 글로벌 설치한 pnpm, pm2가 프로젝트 CI/CD 파이프라인에도 동일하게 적용되는지 검토해 주세요.
7-13
: 네이밍 및 구조 확인
.env
,.env.production
등 중요한 설정 파일이 Docker 이미지에 그대로 포함됩니다. 비밀 값이 안전하게 관리되고 있는지 다시 한 번 점검해 보시는 것을 권장합니다.
15-17
: 프로덕션 의존성만 설치
운영 환경에서 devDependencies를 필요로 하지 않는다면 최적화에 유리합니다. 다만, 서버 실행 시 필요한 빌드 스크립트 등을 devDependencies에서만 제공받지는 않는지 재확인해 주세요.package.json (1)
15-15
: 의존성 이동이 적절합니다
@sentry/nextjs
를devDependencies
에서dependencies
로 이동한 것은 적절합니다. Sentry는 프로덕션 환경에서 에러 추적을 위해 필요한 런타임 의존성이기 때문입니다.
- name: Install dependencies | ||
run: | | ||
npm install -g pnpm | ||
pnpm install --frozen-lockfile | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
의존성 캐싱 전략을 추가하세요
빌드 시간을 단축하고 효율성을 높이기 위해 pnpm 의존성 캐싱을 추가하는 것이 좋습니다.
- name: Install dependencies
+ - uses: actions/cache@v4
+ with:
+ path: |
+ ~/.pnpm-store
+ ${{ github.workspace }}/.pnpm-store
+ key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
+ restore-keys: |
+ ${{ runner.os }}-pnpm-
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
Committable suggestion skipped: line range outside the PR's diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (5)
.gitignore (2)
84-86
: 환경 변수 파일 패턴 재검토 필요
.env*
패턴이 너무 광범위할 수 있습니다. 특정 환경 변수 파일만 제외하도록 패턴을 구체화하는 것이 좋습니다.다음과 같이 변경하는 것을 고려해보세요:
-# envs -.env* -!.env.sample +# Environment variables +.env +.env.local +.env.*.local +!.env.example +!.env.sample
21-21
: 중복된 패턴 정리 필요
.DS_Store
와.DS_*
패턴이 macOS와 React 섹션에서 중복되어 있습니다.중복을 제거하고 한 곳에서만 정의하는 것이 좋습니다:
# General .DS_Store .AppleDouble .LSOverride ### react ### -.DS_* +# React specific backup files **/*.backup.* **/*.back.*Also applies to: 218-218
src/apis/instance.request.ts (2)
25-25
: 에러 필드의 타입 지정
SuccessType
내error
필드를null | ErrorType
으로 바꾼 것은 에러 정보를 담기에 더 적절해 보입니다. 이로 인해 다른 곳에서error
필드를 참조하거나 처리하는 로직이 있다면,null
가능성을 고려한 추가 방어 로직이 필요한지 확인해 주세요.
60-60
: 에러 컬렉션 인자error?: Record<string, Error>
HTTP Status Code별로Error
객체를 매핑하여 던져주는 방식은 유연한 편입니다. 다만, 실제 사용 시err as Response
캐스팅 부분이 무조건 성공한다는 가정에 의존하고 있으므로, 예외 상황을 대비해 방어 코드를 추가할 수 있는지 고려해보세요.src/components/auth-required/Header.tsx (1)
89-89
: 사용자명 참조 방식 변경
profiles?.user?.username
대신profiles?.username
으로 직접 접근하도록 변경되었습니다. UI나 기타 의존 코드가 정상 동작하는지, 특히null
또는undefined
처리에 주의해 주세요.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.gitignore
(3 hunks)src/apis/instance.request.ts
(2 hunks)src/app/(with-tracker)/(auth-required)/main/Content.tsx
(1 hunks)src/components/auth-required/Header.tsx
(1 hunks)src/types/apis/user.type.ts
(1 hunks)
🔇 Additional comments (4)
src/types/apis/user.type.ts (1)
7-11
: UserDto 구조 변경 확인 필요
UserDto
타입에서 기존에 중첩되어 있던user
객체가 사라지고 최상위 필드로 승격되었습니다. API 응답 처리 로직 및 의존하는 컴포넌트(예:Header
등)와의 호환성을 재검토하시기 바랍니다.src/apis/instance.request.ts (1)
16-19
: 에러 타입 구조 명시
ErrorType
선언이 명확해져서 좋습니다. 하지만code
와statusCode
라는 필드가 API 응답 형식과 일치하는지 다시 한번 검토해보시면 좋겠습니다.src/app/(with-tracker)/(auth-required)/main/Content.tsx (1)
30-38
: 페이지 매개변수 구조 간소화
pageParam
의 기본값을 빈 문자열로 설정하고,getNextPageParam
및getPreviousPageParam
을 단순화함으로써 코드 가독성이 좋아졌습니다. 이후lastPage.nextCursor
가null
일 때 로직이 어떻게 처리되는지(예: 무한 스크롤 로딩 중단 등) 충분히 확인해 주세요.src/components/auth-required/Header.tsx (1)
85-85
: 프로필 이미지 경로 구조 변경
profiles?.user?.profile.thumbnail
대신profiles?.profile.thumbnail
로 변경되어,UserDto
구조 변경과 일관성을 맞추었습니다. 기존 코드와 함께 사용되는 부분은 없는지 재확인하시면 좋겠습니다.
|
||
# Sentry Config File | ||
.env.sentry-build-plugin | ||
# End of https://www.toptal.com/developers/gitignore/api/windows,macos,visualstudiocode,nextjs,react,git,node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Docker 관련 파일 무시 패턴 추가 필요
Docker 배포 설정이 추가되었으므로, Docker 관련 파일에 대한 무시 패턴도 추가하는 것이 좋습니다.
파일 끝에 다음 섹션을 추가하세요:
+### Docker ###
+# Docker temporary files
+.docker
+
+# Docker build context
+docker-compose.override.yml
+
+# Docker volumes
+docker-volumes/
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
# End of https://www.toptal.com/developers/gitignore/api/windows,macos,visualstudiocode,nextjs,react,git,node | |
# End of https://www.toptal.com/developers/gitignore/api/windows,macos,visualstudiocode,nextjs,react,git,node | |
### Docker ### | |
# Docker temporary files | |
.docker | |
# Docker build context | |
docker-compose.override.yml | |
# Docker volumes | |
docker-volumes/ |
Summary by CodeRabbit
새로운 기능
개선 사항
문서