Files
jaengseung-made/next.config.ts
gahusb 5d4599642a feat(deploy): Next standalone 출력 + Dockerfile (NAS self-host Phase 3)
- next.config: output 'standalone' + outputFileTracingRoot(workspace 중첩 방지)
- Dockerfile(멀티스테이지, NEXT_PUBLIC_* build-arg) + .dockerignore
- maxDuration은 Vercel 운영 보호 위해 유지(self-host에선 무시됨)
- 로컬 빌드 검증: .next/standalone/server.js 루트 생성 확인

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 14:50:08 +09:00

58 lines
2.4 KiB
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// self-host(NAS) 배포용 standalone 출력. Vercel은 이 설정을 무시하므로 양쪽 호환.
output: 'standalone',
// workspace/ 하위 프로젝트라 Next가 상위를 추적 루트로 오인 → standalone 중첩 방지 위해 고정
outputFileTracingRoot: process.cwd(),
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: "X-XSS-Protection", value: "1; mode=block" },
{
key: "Strict-Transport-Security",
value: "max-age=63072000; includeSubDomains; preload",
},
{
key: "Permissions-Policy",
value: "camera=(), microphone=(), geolocation=()",
},
],
},
{
source: "/api/:path*",
headers: [
{ key: "Cache-Control", value: "no-store, max-age=0" },
{ key: "X-Frame-Options", value: "DENY" },
],
},
];
},
async redirects() {
return [
// Music 사업부 마이그
{ source: '/services/music', destination: '/music/packs', permanent: true },
{ source: '/services/music/samples', destination: '/music/samples', permanent: true },
{ source: '/studio', destination: '/music/studio', permanent: true },
// 커스텀 외주 마이그
{ source: '/freelance', destination: '/work/freelance', permanent: true },
{ source: '/services/website', destination: '/work/website', permanent: true },
{ source: '/services/website/samples/:slug', destination: '/work/website/samples/:slug', permanent: true },
// 블로그 자동화 폐기(2026-05-29 재정의): 기존 URL은 제품 라인 허브로 안내
{ source: '/services/blog', destination: '/work', permanent: true },
{ source: '/work/blog', destination: '/work', permanent: true },
// 사주 마이그 (단순 URL, 카탈로그 spec은 보류)
{ source: '/saju', destination: '/work/saju', permanent: true },
{ source: '/saju/input', destination: '/work/saju/input', permanent: true },
{ source: '/saju/result', destination: '/work/saju/result', permanent: true },
];
},
};
export default nextConfig;