-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
129 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# 버전 컨트롤 시스템 | ||
.git | ||
.gitignore | ||
.gitattributes | ||
|
||
# 노드 모듈 및 로그 | ||
node_modules | ||
npm-debug.log | ||
|
||
# 개발 및 빌드 파일 | ||
*.log | ||
*.md | ||
*.sh | ||
|
||
# 테스트 관련 파일 | ||
test | ||
coverage | ||
|
||
# 개발 환경 설정 파일 | ||
.env | ||
.env.local | ||
.env.development | ||
.env.test | ||
.env.production | ||
|
||
# IDE 관련 파일 | ||
.vscode | ||
.idea | ||
*.sublime-project | ||
*.sublime-workspace | ||
|
||
# OS 생성 파일 | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# 빌드 산출물 | ||
dist | ||
build | ||
|
||
# 임시 파일 | ||
tmp | ||
temp | ||
|
||
# Docker 관련 파일 | ||
Dockerfile | ||
docker-compose.yaml | ||
.dockerignore | ||
|
||
# 기타 불필요한 파일 | ||
README.md | ||
LICENSE |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: NEST CI # 워크플로우의 이름 | ||
run-name: ${{ github.actor }} is learning GitHub Actions # 워크플로우 실행 시 표시될 이름 | ||
|
||
on: # 워크플로우 트리거 조건 | ||
pull_request: | ||
branches: [dev] # dev 브랜치로의 PR에서 실행 | ||
push: | ||
branches: ['**'] # 모든 브랜치에 대한 push에서 실행 | ||
|
||
jobs: | ||
unit-test: # job의 이름 | ||
name: Unit Test # GitHub UI에 표시될 job 이름 | ||
runs-on: ubuntu-latest # 실행 환경 (최신 Ubuntu) | ||
|
||
steps: | ||
- name: Checkout # 저장소 코드 체크아웃 | ||
uses: actions/checkout@v4 # 공식 checkout 액션 사용 | ||
|
||
- name: Start Docker containers # Docker 컨테이너 시작 | ||
run: docker compose up -d # 백그라운드에서 Docker Compose 실행 | ||
env: | ||
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | ||
POSTGRES_DB: ${{ secrets.POSTGRES_DB }} | ||
SERVER_PORT: ${{ secrets.SERVER_PORT }} | ||
POSTGRES_USER: ${{ secrets.POSTGRES_USER }} | ||
GF_USER: ${{ secrets.GF_USER }} | ||
GF_PASSWORD: ${{ secrets.GF_PASSWORD }} | ||
|
||
- name: Install Node.js # Node.js 설치 | ||
uses: actions/setup-node@v4 # 공식 Node.js 설치 액션 사용 | ||
with: | ||
node-version: '20' # Node.js 버전 20 사용 | ||
|
||
- name: Install packages # 의존성 패키지 설치 | ||
run: npm ci # CI 환경에 적합한 설치 명령 사용 | ||
|
||
- name: Run tests # 테스트 실행 | ||
run: npm test # package.json에 정의된 테스트 스크립트 실행 | ||
|
||
- name: Stop containers # Docker 컨테이너 정지 | ||
if: always() # 이전 단계의 성공/실패와 관계없이 항상 실행 | ||
run: docker compose down # Docker Compose로 실행된 컨테이너 중지 및 제거 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
FROM node:14 | ||
# 베이스 이미지 선택 | ||
FROM node:18-alpine | ||
|
||
# 필요한 패키지 설치 | ||
RUN apt-get update && apt-get install -y \ | ||
libvips-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
# 작업 디렉토리 설정 | ||
WORKDIR /app | ||
|
||
# 애플리케이션 코드 복사 | ||
WORKDIR /usr/src/app | ||
# 환경 변수 설정 | ||
ENV NODE_ENV=production | ||
|
||
# package.json과 package-lock.json 복사 | ||
COPY package*.json ./ | ||
|
||
# 종속성 설치 | ||
RUN npm install | ||
RUN npm ci --only=production | ||
|
||
# 애플리케이션 코드 복사 | ||
# 소스 코드 복사 | ||
COPY . . | ||
|
||
# 애플리케이션 빌드 | ||
RUN npm run build | ||
|
||
# 불필요한 개발 종속성 제거 | ||
RUN npm prune --production | ||
|
||
# 애플리케이션 실행을 위한 포트 노출 | ||
EXPOSE ${SERVER_PORT} | ||
|
||
# 애플리케이션 실행 | ||
CMD [ "node", "app.js" ] | ||
CMD ["node", "dist/main"] |
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