Conversation
This commit adds the necessary files and documentation to deploy the application to Google Cloud Platform. It includes: - A `Dockerfile` to containerize the application. - A `.dockerignore` file to optimize the Docker build. - A `cloudbuild.yaml` file to define the build and deployment pipeline for Google Cloud Build. - A `DEPLOY.md` file with detailed instructions on how to deploy the application to Google Cloud Run.
This commit adds the necessary files and documentation to deploy the application to Google Cloud Platform. It includes: - A `Dockerfile` to containerize the application. - A `.dockerignore` file to optimize the Docker build. - A `cloudbuild.yaml` file to define the build and deployment pipeline for Google Cloud Build. - A `DEPLOY.md` file with detailed instructions on how to deploy the application to Google Cloud Run, including instructions for mapping a custom domain.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds Google Cloud Platform (GCP) deployment configuration to enable containerized deployment of the Universal Image to ICO Converter application using Google Cloud Build and Cloud Run.
Key Changes:
- Adds Docker containerization with multi-stage build optimization
- Configures Google Cloud Build pipeline for automated CI/CD
- Provides comprehensive deployment documentation
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
cloudbuild.yaml |
Cloud Build configuration for Docker build, push, and Cloud Run deployment |
Dockerfile |
Multi-stage Docker build for Next.js application with production optimization |
DEPLOY.md |
Complete deployment guide with prerequisites, steps, and domain mapping instructions |
.dockerignore |
Docker build context exclusions for efficient image building |
| args: ['build', '-t', 'gcr.io/$PROJECT_ID/$_SERVICE_NAME:$COMMIT_SHA', '.'] | ||
|
|
||
| # Push the container image to Container Registry | ||
| - name: 'gcr.io/cloud-builders/docker' | ||
| args: ['push', 'gcr.io/$PROJECT_ID/$_SERVICE_NAME:$COMMIT_SHA'] |
There was a problem hiding this comment.
The substitution variable $_SERVICE_NAME is used but not defined anywhere in the build configuration. This will cause the build to fail. Either define it as a substitution variable or replace it with a hardcoded service name like 'toico' to match line 16.
| args: ['build', '-t', 'gcr.io/$PROJECT_ID/$_SERVICE_NAME:$COMMIT_SHA', '.'] | |
| # Push the container image to Container Registry | |
| - name: 'gcr.io/cloud-builders/docker' | |
| args: ['push', 'gcr.io/$PROJECT_ID/$_SERVICE_NAME:$COMMIT_SHA'] | |
| args: ['build', '-t', 'gcr.io/$PROJECT_ID/toico:$COMMIT_SHA', '.'] | |
| # Push the container image to Container Registry | |
| - name: 'gcr.io/cloud-builders/docker' | |
| args: ['push', 'gcr.io/$PROJECT_ID/toico:$COMMIT_SHA'] |
| args: ['build', '-t', 'gcr.io/$PROJECT_ID/$_SERVICE_NAME:$COMMIT_SHA', '.'] | ||
|
|
||
| # Push the container image to Container Registry | ||
| - name: 'gcr.io/cloud-builders/docker' | ||
| args: ['push', 'gcr.io/$PROJECT_ID/$_SERVICE_NAME:$COMMIT_SHA'] |
There was a problem hiding this comment.
Same issue as line 4 - $_SERVICE_NAME is undefined. This should be consistent with the hardcoded 'toico' service name used in the deployment step.
| args: ['build', '-t', 'gcr.io/$PROJECT_ID/$_SERVICE_NAME:$COMMIT_SHA', '.'] | |
| # Push the container image to Container Registry | |
| - name: 'gcr.io/cloud-builders/docker' | |
| args: ['push', 'gcr.io/$PROJECT_ID/$_SERVICE_NAME:$COMMIT_SHA'] | |
| args: ['build', '-t', 'gcr.io/$PROJECT_ID/toico:$COMMIT_SHA', '.'] | |
| # Push the container image to Container Registry | |
| - name: 'gcr.io/cloud-builders/docker' | |
| args: ['push', 'gcr.io/$PROJECT_ID/toico:$COMMIT_SHA'] |
| COPY --from=builder /app/node_modules ./node_modules | ||
| COPY --from=builder /app/next.config.ts ./next.config.ts |
There was a problem hiding this comment.
Copying the entire node_modules directory from the builder stage defeats the purpose of a multi-stage build. For a production Next.js app, you should install only production dependencies in the runner stage with 'RUN npm ci --only=production' after copying package.json.
| COPY --from=builder /app/node_modules ./node_modules | |
| COPY --from=builder /app/next.config.ts ./next.config.ts | |
| COPY --from=builder /app/package-lock.json ./package-lock.json | |
| COPY --from=builder /app/next.config.ts ./next.config.ts | |
| RUN npm ci --only=production |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.