-
Notifications
You must be signed in to change notification settings - Fork 7
[조영욱] sprint11 #87
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
Merged
O-Seonsik
merged 12 commits into
codeit-bootcamp-nodejs:조영욱
from
youngwookjo:조영욱-sprint11
Oct 21, 2025
The head ref may contain hidden characters: "\uC870\uC601\uC6B1-sprint11"
Merged
[조영욱] sprint11 #87
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8ee0dcc
add:cd,ci 추가
youngwookjo a6bb670
package,ci 수정
youngwookjo cf0390d
ci 수정
youngwookjo 3487785
ci 수정
youngwookjo 0630a46
셋업수정
youngwookjo 8c01117
셋업수정
youngwookjo 76de387
셋업수정
youngwookjo 7ec8402
셋업수정
youngwookjo d844ec2
ci 값 수정
youngwookjo a6f9fcb
ci 값 수정
youngwookjo e174d00
TEST 수정
youngwookjo 3ec118e
독커추가
youngwookjo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Dependencies | ||
| node_modules | ||
| *.log | ||
|
|
||
| # Git | ||
| .git | ||
| .gitignore | ||
|
|
||
| # Environment | ||
| .env | ||
| .env.* | ||
|
|
||
| # OS / Editor | ||
| .DS_Store | ||
| Thumbs.db | ||
| .vscode | ||
| .idea | ||
|
|
||
| # Build artifacts | ||
| dist | ||
| build | ||
| coverage | ||
|
|
||
| # Docker | ||
| .dockerignore |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # .github/workflows/deploy.yml | ||
| name: Deploy to EC2 | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Deploy to EC2 | ||
| uses: appleboy/ssh-action@v1.2.2 | ||
| with: | ||
| host: ${{ secrets.EC2_HOST }} | ||
| username: ${{ secrets.EC2_USER }} | ||
| key: ${{ secrets.EC2_PRIVATE_KEY }} | ||
| port: 22 | ||
| script: | | ||
| # start.sh에 실행 권한 주기 | ||
| chmod +x /home/ec2-user/3-sprint-mission/infra/ec2/start.sh | ||
| # 배포 스크립트 실행 | ||
| bash /home/ec2-user/3-sprint-mission/infra/ec2/start.sh |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ["**"] | ||
|
|
||
| jobs: | ||
| panda-market-test: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| services: | ||
| postgres: | ||
| image: postgres:15 | ||
| env: | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: password | ||
| POSTGRES_DB: test_db | ||
| ports: | ||
| - 5432:5432 | ||
| options: >- | ||
| --health-cmd "pg_isready -U postgres" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: "lts/*" | ||
|
|
||
| - name: Cache node modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.npm | ||
| key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-node- | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install | ||
|
|
||
| - name: Type Check | ||
| run: npm run typecheck | ||
|
|
||
| - name: Apply Prisma migrations | ||
| run: npx prisma migrate deploy | ||
| env: | ||
| DATABASE_URL: postgres://postgres:password@localhost:5432/test_db | ||
|
|
||
| - name: Run Tests | ||
| run: npm run test | ||
| env: | ||
| DATABASE_URL: postgres://postgres:password@localhost:5432/test_db | ||
| JWT_ACCESS_SECRET: test_jwt_access_secret | ||
| JWT_REFRESH_SECRET: test_jwt_refresh_secret |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # ==================================== | ||
| # 빌드 스테이지 (build stage) | ||
| # ==================================== | ||
| ARG NODE_VERSION=22.16.0 | ||
| FROM node:${NODE_VERSION} AS my-build-stage | ||
|
|
||
| # 작업 디렉터리 | ||
| WORKDIR /docker-compose-app | ||
|
|
||
| # 의존성 모듈 설치 | ||
| COPY package*.json ./ | ||
| RUN npm ci | ||
|
|
||
| # openssl 설치 | ||
| RUN apt-get update -y && apt-get install -y openssl | ||
|
|
||
| # 애플리케이션 소스 복사 | ||
| COPY . . | ||
|
|
||
| # Prisma 설정 및 생성 | ||
| RUN npx prisma generate | ||
|
|
||
| # 빌드 | ||
| RUN npm run build | ||
|
|
||
| # 프로덕션 의존성만 남기기 | ||
| RUN npm prune --omit=dev | ||
|
|
||
|
|
||
| # ==================================== | ||
| # 런타임 스테이지 (runtime stage) | ||
| # ==================================== | ||
| FROM node:${NODE_VERSION}-slim AS runtime | ||
|
|
||
| # openssl 설치 | ||
| RUN apt-get update -y && apt-get install -y openssl | ||
|
|
||
| # 보안을 위해 node 사용자 사용 | ||
| USER node | ||
| WORKDIR /docker-compose-app | ||
|
|
||
| # 필요한 파일만 복사 | ||
| COPY --chown=node:node --from=my-build-stage /docker-compose-app/package*.json ./ | ||
| COPY --chown=node:node --from=my-build-stage /docker-compose-app/node_modules ./node_modules | ||
| COPY --chown=node:node --from=my-build-stage /docker-compose-app/dist ./dist | ||
| COPY --chown=node:node --from=my-build-stage /docker-compose-app/prisma ./prisma | ||
|
|
||
| # 환경 | ||
| ENV NODE_ENV=production | ||
|
|
||
| EXPOSE 3000 | ||
|
|
||
| # 앱 시작: dist/app.js 기준 | ||
| ENTRYPOINT [ "sh", "-c", "npx prisma migrate deploy && npm run start" ] | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: youngwook-docker-app | ||
|
|
||
| services: | ||
| my-express-app: | ||
| image: youngwookcho/docker-app-image:1.0.0 | ||
| build: | ||
| context: . | ||
| dockerfile: ./Dockerfile | ||
| args: | ||
| - NODE_VERSION=22.16.0 | ||
| tags: | ||
| - youngwookcho/docker-app-image:1.0.0 | ||
| - youngwookcho/docker-app-image | ||
| container_name: docker-app-container | ||
| env_file: | ||
| - .env | ||
| environment: | ||
| - PORT=3000 | ||
| - DATABASE_URL=${POSTGRES_DATABASE_URL} | ||
| networks: | ||
| - docker-app-network | ||
| ports: | ||
| - 4000:3000 | ||
| depends_on: | ||
| my-mypostgres-db: | ||
| condition: service_healthy | ||
| restart: on-failure | ||
| my-mypostgres-db: | ||
| image: postgres:17.5 | ||
| container_name: mypostgres-db-container | ||
| env_file: | ||
| - .env | ||
| environment: | ||
| - POSTGRES_USER=${POSTGRES_USER} | ||
| - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
| - POSTGRES_DB=${POSTGRES_DB} | ||
| ports: | ||
| #로컬환경에서 5432가아닌 5433 사용중이라 컨테이너 포트 5434로 매핑 | ||
| - 5434:5432 | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready -U postgres -d ${POSTGRES_DB}"] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 5 | ||
| networks: | ||
| - docker-app-network | ||
| volumes: | ||
| - docker-app-volume:/var/lib/postgresql/data | ||
|
|
||
| networks: | ||
| docker-app-network: | ||
| name: docker-app-network | ||
|
|
||
| volumes: | ||
| docker-app-volume: | ||
| name: docker-app-volume |
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
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
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
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
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
Oops, something went wrong.
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.
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.
이거 중복으로 install 해야 하는 이유가 혹시 있었나요 ??