-
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
모노레포 프로덕트를 위한 패키지 설정을 추가합니다 + Docker 설정 추가 #1
Merged
Conversation
This file contains 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
- package.json의 workspace config 업데이트 - pnpm-workspace.yaml 추가
- 각 package의 이름은 @[directory]/[subdirectory] 의 컨벤션을 따릅니다 - i.e. apps/auth > "@apps/auth" - 두 패키지는 기본적으로 root project의 tsconfig를 상속합니다. @app/auth는 dependency로 @libs/common을 설치합니다
1) path 프로퍼티의 @apps/common -> @libs/common 으로 수정합니다 - package naming convention을 따릅니다. - package naming convention은 commit: 7670846 참고 2) include를 정의하여 compile할 directory를 whitelisting 합니다. (/app/**/*, /libs/**/*)
1) root 디렉토리에서 nest cli를 호출하는 script를 삭제했습니다. 2) pnpm을 이용해 전체 패키지를 관리하는 스크립트를 추가했습니다.
@app/auth가 @libs/common에 의존함에 따라 dependency 트리에 추가 됩니다.
각 패키지 하위의 dist, node_modules, tsconfig.tsbuildinfo 를 git 버전관리에서 제외합니다.
1) Dockerfile.app 추가 - standalone nest 애플리케이션의 이미지를 빌드하는 스크립트입니다. - apps 하위의 microservice를 빌드할 때 이 Dockerfile을 이용합니다. - 인자로 PKG_NAME, PORT를 전달받습니다. - PKG_NAME: 빌드하고자 하는 패키지 이름 (i.e. @apps/auth) - PORT: container가 노출할 port 2) .dockerignore 추가 - Dockerfile 빌드 타임 최적화를 위해 필요하지 않은 파일들을 무시합니다. 3) docker-compose.yaml 추가 - 각 microservice 들의 image를 실행/구성하도록 정의합니다. (지금은 auth만 있긴함 ㅎ)
LGTM! 고생하셨습니다! |
EeeasyCode
approved these changes
Jun 15, 2024
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.
LGTM!
leobang17
added a commit
that referenced
this pull request
Sep 21, 2024
#1 development 브랜치에 PR이 merge 될 때 - secrets.DEV_ENV를 환경변수로 전달 - docker 이미지에 dev tag - docker-compose-dev.yaml 을 이용해서 컨테이너 구성 - docker container name은 접미사 '-dev'를 붙임 - 4xxx port로 포워딩 #2 main 브랜치에 push 할 때 - secrets.PROD_ENV를 환경변수로 전달 - docker 이미지에 prod tag - docker-compose-prod.yaml 을 이용해 컨테이너 구성 - docker container name은 전과 동일 - 3xxx port로 포워딩
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.
1. 각 패키지의 naming convention을 재정의하고, library (공유 패키지)에 대한 의존성을 연결합니다.
naming convention은 다음과 같습니다:
기존의
libs/common
은@app/common
으로 정의되어 있었습니다. 이를@libs/common
으로 변경하고, 해당 패키지 명으로 의존성을 연결합니다.2. package.json 의 스크립트 수정
3. 각 패키지의 빌드 결과물 및 디펜던시를 git 버전관리에서 제외
4. 프로젝트 이름 변경
yapp-web-2-server -> hedwig-server
5. Docker 스크립트 및 compose 작성
커밋 메시지에 상세하게 남겨놓았습니다.