Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Using pnpm@latest can lead to inconsistent builds across environments. Consider pinning to a specific version like pnpm@9.0.0 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 |
There was a problem hiding this comment.
Using pnpm@latest can lead to inconsistent builds across environments. Consider pinning to a specific version like pnpm@9.0.0 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 |
There was a problem hiding this comment.
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 로그인 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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