Skip to content

Conversation

kyeoungwoon
Copy link
Contributor

#️⃣ Related Issues

연관된 모든 Issue를 작성해주세요.

🧑‍💻 작업 내용

어떤 작업을 진행했는지 자세하게 작성해주세요.

💾 작업 결과 (선택)

사진, 영상 등을 첨부해주세요.

💬 리뷰 시 요청사항 (선택)

Reviewer는 코드 리뷰의 코멘트에 코멘트를 강조하고 싶은 정도를 Pn 규칙
맞춰서 표기해 주세요.

📝 Checklist

  • Reviewer를 추가했나요?
  • Convention을 준수했나요?

@Copilot Copilot AI review requested due to automatic review settings August 12, 2025 09:56
@kyeoungwoon kyeoungwoon requested a review from a team as a code owner August 12, 2025 09:56
@kyeoungwoon kyeoungwoon requested review from strfunctionk, S-Gihun and duwlsssss and removed request for a team August 12, 2025 09:56
Copy link

vercel bot commented Aug 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Project Deployment Preview Comments Updated (UTC)
haru-web Ready Preview Comment Aug 12, 2025 5:05pm

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements Docker-based CI/CD setup for a Next.js application, adding containerization and automated deployment capabilities through GitHub Actions.

  • Adds multi-stage Docker configuration for building and running Next.js applications
  • Creates GitHub Actions workflow for automated Docker image building and deployment
  • Implements SSH-based server deployment with Docker container management

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
scripts/docker/Dockerfile Multi-stage Docker build configuration for Next.js app using Node 24 Alpine
.github/workflows/docker-deploy.yml CI/CD workflow for building Docker images and deploying to server via SSH

FROM node:24-alpine AS builder
WORKDIR /app

RUN corepack enable && corepack prepare pnpm@latest --activate
Copy link
Preview

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using pnpm@latest can lead to inconsistent builds across environments. Consider pinning to a specific version like [email protected] to ensure reproducible builds.

Suggested change
RUN corepack enable && corepack prepare pnpm@latest --activate
RUN corepack enable && corepack prepare pnpm@9.0.0 --activate

Copilot uses AI. Check for mistakes.

FROM node:24-alpine
WORKDIR /app

RUN corepack enable && corepack prepare pnpm@latest --activate
Copy link
Preview

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using pnpm@latest can lead to inconsistent builds across environments. Consider pinning to a specific version like [email protected] to ensure reproducible builds.

Suggested change
RUN corepack enable && corepack prepare pnpm@latest --activate
RUN corepack enable && corepack prepare pnpm@9.0.0 --activate

Copilot uses AI. Check for mistakes.

Comment on lines +17 to +19
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/public ./public
Copy link
Preview

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copying the entire node_modules directory from the builder stage is inefficient. Consider using pnpm install --prod in the runtime stage to only install production dependencies, which will significantly reduce image size.

Suggested change
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=builder /app/public ./public
RUN pnpm install --prod --frozen-lockfile

Copilot uses AI. Check for mistakes.

- name: Checkout code
uses: actions/checkout@v4

# 3. Docker Hub 로그인
Copy link
Preview

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The step numbering in comments is inconsistent. Step 3 appears before step 2 (line 30). Consider reordering the comments to match the actual execution order.

Suggested change
# 3. Docker Hub 로그인
# 2. Docker Hub 로그인

Copilot uses AI. Check for mistakes.

script: |
docker stop ${{ secrets.SERVER_DOCKER_CONTAINER_NAME }} || true
docker rm ${{ secrets.SERVER_DOCKER_CONTAINER_NAME }} || true
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY_NAME}}:latest
Copy link
Preview

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after DOCKER_REPOSITORY_NAME and before the closing }}. This should be ${{ secrets.DOCKER_REPOSITORY_NAME }}:latest for consistency with other variable references.

Suggested change
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY_NAME}}:latest
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY_NAME }}:latest

Copilot uses AI. Check for mistakes.

Comment on lines 55 to 56
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY_NAME}}:latest
docker run -d -p ${{ secrets.DOCKER_HOST_PORT }}:${{ secrets.DOCKER_CONTAINER_PORT }} --name ${{ secrets.SERVER_DOCKER_CONTAINER_NAME }} --restart always ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY_NAME}}:latest
Copy link
Preview

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after DOCKER_REPOSITORY_NAME and before the closing }}. This should be ${{ secrets.DOCKER_REPOSITORY_NAME }}:latest for consistency with other variable references.

Suggested change
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY_NAME}}:latest
docker run -d -p ${{ secrets.DOCKER_HOST_PORT }}:${{ secrets.DOCKER_CONTAINER_PORT }} --name ${{ secrets.SERVER_DOCKER_CONTAINER_NAME }} --restart always ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY_NAME}}:latest
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY_NAME }}:latest
docker run -d -p ${{ secrets.DOCKER_HOST_PORT }}:${{ secrets.DOCKER_CONTAINER_PORT }} --name ${{ secrets.SERVER_DOCKER_CONTAINER_NAME }} --restart always ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY_NAME }}:latest

Copilot uses AI. Check for mistakes.

Copy link

github-actions bot commented Aug 12, 2025

✨ Vercel Preview Deployed

📦 PR #241 by @kyeoungwoon
🌿 [cicd/#239-docker] → [develop]
📅 KST 2025-08-13 01:51:37

🔗 Links

✨ Preview 사이트 보러가기

💡 변경사항을 실제 환경에서 확인해보세요!


Powered by Vercel

bash shell 이 원인인가 싶어서 변경 시도
@kyeoungwoon kyeoungwoon marked this pull request as draft August 13, 2025 01:45
@kyeoungwoon kyeoungwoon changed the title [Feat] Docker를 통한 CI/CD 설정 [WIP] [Feat] Docker를 통한 CI/CD 설정 Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant