-
Notifications
You must be signed in to change notification settings - Fork 2
[WIP] [Feat] Docker를 통한 CI/CD 설정 #241
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
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 |
scripts/docker/Dockerfile
Outdated
| FROM node:24-alpine AS builder | ||
| WORKDIR /app | ||
|
|
||
| RUN corepack enable && corepack prepare pnpm@latest --activate |
Copilot
AI
Aug 12, 2025
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.
Using pnpm@latest can lead to inconsistent builds across environments. Consider pinning to a specific version like [email protected] to ensure reproducible builds.
| RUN corepack enable && corepack prepare pnpm@latest --activate | |
| RUN corepack enable && corepack prepare pnpm@9.0.0 --activate |
scripts/docker/Dockerfile
Outdated
| FROM node:24-alpine | ||
| WORKDIR /app | ||
|
|
||
| RUN corepack enable && corepack prepare pnpm@latest --activate |
Copilot
AI
Aug 12, 2025
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.
Using pnpm@latest can lead to inconsistent builds across environments. Consider pinning to a specific version like [email protected] to ensure reproducible builds.
| RUN corepack enable && corepack prepare pnpm@latest --activate | |
| RUN corepack enable && corepack prepare pnpm@9.0.0 --activate |
scripts/docker/Dockerfile
Outdated
| COPY --from=builder /app/node_modules ./node_modules | ||
| COPY --from=builder /app/package.json ./package.json | ||
| COPY --from=builder /app/public ./public |
Copilot
AI
Aug 12, 2025
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.
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.
| 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 |
.github/workflows/docker-deploy.yml
Outdated
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # 3. Docker Hub 로그인 |
Copilot
AI
Aug 12, 2025
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.
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.
| # 3. Docker Hub 로그인 | |
| # 2. Docker Hub 로그인 |
.github/workflows/docker-deploy.yml
Outdated
| 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 |
Copilot
AI
Aug 12, 2025
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.
Missing space after DOCKER_REPOSITORY_NAME and before the closing }}. This should be ${{ secrets.DOCKER_REPOSITORY_NAME }}:latest for consistency with other variable references.
| docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY_NAME}}:latest | |
| docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY_NAME }}:latest |
.github/workflows/docker-deploy.yml
Outdated
| 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
AI
Aug 12, 2025
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.
Missing space after DOCKER_REPOSITORY_NAME and before the closing }}. This should be ${{ secrets.DOCKER_REPOSITORY_NAME }}:latest for consistency with other variable references.
| 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 |
✨ Vercel Preview Deployed📦 PR #241 by @kyeoungwoon 🔗 Links
Powered by Vercel ⚡ |
9246381 to
5bb09da
Compare
#️⃣ Related Issues
🧑💻 작업 내용
💾 작업 결과 (선택)
💬 리뷰 시 요청사항 (선택)
📝 Checklist