master-project
CHAPTER 39 / 50
읽기 약 2분
FUNCTION
Vercel 배포: 환경 변수 + 도메인 + SSL
핵심 개념
Vercel 프로젝트 import·environment 분리·custom domain·SSL·Edge Functions — 프로덕션 배포.
본문
Vercel 프로젝트 Import
1. vercel.com → Add New → Project
2. GitHub 저장소 선택 → Import
3. Framework: Next.js (자동 감지)
4. Root Directory: ./
5. Build Command: pnpm build
6. Output Directory: .next
7. Install Command: pnpm install --frozen-lockfile
8. DeployEnvironment Variables
[Production]
NEXT_PUBLIC_SUPABASE_URL
NEXT_PUBLIC_SUPABASE_ANON_KEY
SUPABASE_SERVICE_ROLE_KEY (Sensitive)
OPENAI_API_KEY (Sensitive)
ANTHROPIC_API_KEY (Sensitive)
STRIPE_SECRET_KEY (Sensitive)
STRIPE_WEBHOOK_SECRET (Sensitive)
NEXT_PUBLIC_APP_URL=https://mysaas.com
[Preview] (PR마다 자동 배포)
- Production과 동일 (또는 staging Supabase)
[Development] (로컬 vercel dev 시)
- 로컬 .env.local 우선Custom Domain
1. Vercel → Project → Settings → Domains
2. mysaas.com 입력
3. DNS 설정:
- A record: @ → 76.76.21.21
- CNAME: www → cname.vercel-dns.com
4. 자동 SSL (Let's Encrypt)
5. 5분~24시간 propagationDNS 설정 (Cloudflare 추천)
Type Name Value Proxy
A @ 76.76.21.21 ❌ (Vercel SSL 위해)
CNAME www cname.vercel-dns.com ❌
# Cloudflare는 Proxy off (Vercel CDN 우선)
# DNS only (gray cloud)Vercel 배포 환경 차이
[Production]
- main 브랜치
- mysaas.com
- 모든 최적화
[Preview]
- PR·feature 브랜치
- random-hash.vercel.app
- 실데이터로 테스트 가능
[Development]
- 로컬 vercel dev
- .env.localnext.config.ts (프로덕션 최적화)
// next.config.ts
import type { NextConfig } from 'next'
const config: NextConfig = {
reactStrictMode: true,
poweredByHeader: false, // X-Powered-By 헤더 제거 (보안)
images: {
remotePatterns: [
{ protocol: 'https', hostname: '*.supabase.co' },
],
formats: ['image/webp', 'image/avif'],
},
// CSP
async headers() {
return [{
source: '/:path*',
headers: [
{ key: 'X-Frame-Options', value: 'DENY' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
{ key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=()' },
{ key: 'Strict-Transport-Security', value: 'max-age=63072000; includeSubDomains; preload' },
],
}]
},
// Edge Runtime (선택)
experimental: {
serverActions: { bodySizeLimit: '10mb' },
},
}
export default configEdge Functions (선택)
// 매우 빠른 응답 (경량 API)
// src/app/api/ping/route.ts
export const runtime = 'edge'
export async function GET() {
return Response.json({ pong: Date.now() })
}Vercel CLI
pnpm add -g vercel
# 로그인
vercel login
# 로컬 환경 변수 가져오기
vercel env pull .env.local
# 프로덕션 배포 (수동)
vercel --prodProduction 배포 체크리스트
[배포 전]
✓ pnpm build 로컬 0 에러
✓ pnpm typecheck 0 에러
✓ E2E 5개 통과
✓ .env Vercel에 모두 입력
✓ Supabase RLS 모든 테이블
[배포 후]
✓ https://mysaas.com 접속
✓ 회원가입 → 로그인 → 대시보드
✓ AI 생성 동작
✓ Stripe Checkout 테스트
✓ 모니터링 대시보드 확인다음 챕터
CH.40 "모니터링: Sentry + GA4 + Clarity".
AI 프롬프트
🤖 AI에게 잘 물어보는 법 — 모델·전략별 프롬프트
Claude
무료: Sonnet 4.6 / Pro $20/mo: Opus 4.6
내 마스터 프로젝트의 Vercel 배포 부분을 분석해서 실전 적용 + 개선 우선순위 3가지를 알려줘.
ChatGPT
무료: GPT-5.5 / Plus $20/mo: GPT-5.5 Pro
Vercel 배포 관련 모범 사례·안티패턴 5개를 비교 분석해서 실전 적용를 위한 추천 방안을 알려줘.
Gemini
무료: 2.5 Flash / Pro $19.99/mo: 3.1 Pro
내 프로젝트 전체에서 Vercel 배포 최적화 가능 위치와 리스크를 보고해줘.
Grok
무료: Grok 4.1 / SuperGrok $30/mo
2026년 한국 1인 개발자 시장의 Vercel 배포 트렌드와 차별화 포인트를 정리해줘.
⭐ 이것만 기억하세요
Vercel 배포: 환경 변수 + 도메인 + SSL는 이 3가지만 확실히 잡으세요
1.Vercel + Custom Domain + SSL = 5분 배포
2..env Vercel에 분리 + Sensitive 표시
3.다음 챕터에서 모니터링
공유하기
진행도 39 / 50