deployment
Next.js deployment - Vercel, Docker, self-hosting strategies
When & Why to Use This Skill
This Claude skill provides comprehensive guidance and automated configurations for deploying Next.js applications across diverse environments. It simplifies the transition from development to production by offering optimized strategies for Vercel, Docker containerization, and self-hosting, ensuring developers can achieve high performance, scalability, and cost-efficiency with minimal friction.
Use Cases
- Case 1: Streamlining Vercel deployments for rapid production delivery with zero-config setups.
- Case 2: Generating optimized Dockerfiles for Next.js to enable consistent containerized deployment on Kubernetes or cloud providers like AWS and GCP.
- Case 3: Implementing self-hosting strategies on private VPS or dedicated servers using the Node.js runtime for full infrastructure control.
- Case 4: Configuring Static Site Generation (SSG) and Edge Runtimes to maximize global performance and minimize latency for end-users.
- Case 5: Fine-tuning next.config.js settings, such as standalone output mode, to reduce Docker image size and improve deployment speed.
| name | deployment |
|---|---|
| description | "Next.js deployment - Vercel, Docker, self-hosting strategies" |
| sasmp_version | "1.3.0" |
| bonded_agent | nextjs-expert |
| bond_type | PRIMARY_BOND |
Deployment Skill
Overview
Deploy Next.js applications to various platforms with optimal configurations.
Capabilities
- Vercel: Zero-config deployment
- Docker: Containerized deployment
- Self-Hosting: Node.js server
- Static Export: Static site generation
- Edge Runtime: Edge function deployment
Examples
# Dockerfile for Next.js
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:18-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
EXPOSE 3000
CMD ["node", "server.js"]
# Vercel deployment
npm i -g vercel
vercel --prod
# Docker deployment
docker build -t nextjs-app .
docker run -p 3000:3000 nextjs-app
next.config.js Options
module.exports = {
output: 'standalone', // For Docker
// output: 'export', // For static
}