Skip to content

Conversation

@Boxuan-Matty-Lin
Copy link
Owner

This pull request introduces Docker support for both development and production environments, updates documentation to reflect the new workflows, and makes minor configuration improvements for deployment. The main changes are the addition of multi-stage Docker builds, Docker Compose files for different environments, and comprehensive updates to the README.md for onboarding and deployment instructions.

Dockerization and Deployment:

  • Added a multi-stage Dockerfile with separate stages for development, build, and production runtime, optimizing for image size and security.
  • Introduced .dockerignore to exclude unnecessary files and directories from Docker build context, reducing image size and improving build times.
  • Added compose.dev.yml for local development with hot reloading and bind mounts, and compose.production.yml for production deployment using the optimized runtime image. [1] [2]

Documentation and Onboarding:

  • Rewrote and expanded README.md to include detailed instructions for local development, Docker-based workflows, production deployment, and testing.

Configuration Improvements:

  • Updated next.config.ts to enable Next.js standalone output, ensuring compatibility with Docker production builds.

@Boxuan-Matty-Lin Boxuan-Matty-Lin added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 29, 2025
@github-actions
Copy link

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 54.92% 78 / 142
🔵 Statements 54.72% 81 / 148
🔵 Functions 54.54% 24 / 44
🔵 Branches 26.75% 42 / 157
File CoverageNo changed files found.
Generated in workflow #14 for commit 1822112 by the Vitest Coverage Report Action

@Boxuan-Matty-Lin Boxuan-Matty-Lin merged commit 581296e into dev Oct 29, 2025
6 checks passed
Copy link

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 adds comprehensive Docker support to the Next.js currency converter application, enabling both development and production deployments via containerization.

  • Configured Next.js for standalone output mode to enable optimized Docker builds
  • Added multi-stage Dockerfile with separate stages for development, building, and production runtime
  • Created Docker Compose configurations for both development (with hot-reload) and production environments

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
next.config.ts Added output: "standalone" to enable Next.js standalone build mode for Docker optimization
Dockerfile Multi-stage build with dev, builder, and runner stages for development and production deployments
compose.dev.yml Development compose configuration with volume mounting and hot-reload support
compose.production.yml Production compose configuration targeting the optimized runner stage
.dockerignore Excludes unnecessary files from Docker build context
README.md Comprehensive documentation for local development, Docker development, and production deployment workflows

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

.vscode
.idea

# Env files (改为在运行容器时注入)
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

Comment contains Chinese text. For consistency with the rest of the English documentation, translate to English: 'Env files (inject at container runtime instead)'.

Suggested change
# Env files (改为在运行容器时注入)
# Env files (inject at container runtime instead)

Copilot uses AI. Check for mistakes.

# Copy source code and build
COPY . .
# Important: ensure next.config.js has { output: 'standalone' }
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

Comment references 'next.config.js' but the actual file is 'next.config.ts'. Update the comment to reflect the correct filename.

Suggested change
# Important: ensure next.config.js has { output: 'standalone' }
# Important: ensure next.config.ts has { output: 'standalone' }

Copilot uses AI. Check for mistakes.
- .env.development
environment:
NODE_ENV: development
CHOKIDAR_USEPOLLING: "1"
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

Line has trailing whitespace. Remove the trailing spaces after the closing quote for cleaner formatting.

Suggested change
CHOKIDAR_USEPOLLING: "1"
CHOKIDAR_USEPOLLING: "1"

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +16
restart: unless-stopped

No newline at end of file
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

File ends with a line containing only whitespace. Remove the trailing spaces on the final line.

Suggested change
restart: unless-stopped
restart: unless-stopped

Copilot uses AI. Check for mistakes.
WORKDIR /app
# Install base tools and pin pnpm via Corepack
RUN apk add --no-cache libc6-compat ca-certificates \
&& corepack enable && corepack prepare pnpm@9.12.0 --activate
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

pnpm version 9.12.0 is hardcoded in multiple stages (lines 6 and 23). Consider defining it as a build ARG at the top of the Dockerfile to maintain consistency and simplify version updates.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MVP 1.5 Docker Setting and README writing MVP 1: Build frontend and API for latest data

2 participants