2025-08-21 09:41:46 +09:00
|
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
|
const nextConfig = {
|
|
|
|
|
// Docker 빌드 최적화
|
|
|
|
|
output: "standalone",
|
|
|
|
|
|
|
|
|
|
// ESLint 빌드 시 무시 (프로덕션 빌드 성공을 위해)
|
|
|
|
|
eslint: {
|
|
|
|
|
ignoreDuringBuilds: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// TypeScript 오류도 무시 (필요한 경우)
|
|
|
|
|
typescript: {
|
|
|
|
|
ignoreBuildErrors: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 실험적 기능 활성화
|
|
|
|
|
experimental: {
|
|
|
|
|
outputFileTracingRoot: undefined,
|
|
|
|
|
},
|
|
|
|
|
|
2025-10-01 16:15:53 +09:00
|
|
|
// API 프록시 설정 - 백엔드로 요청 전달
|
|
|
|
|
async rewrites() {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
source: "/api/:path*",
|
|
|
|
|
destination: "http://host.docker.internal:8080/api/:path*",
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
},
|
2025-08-21 09:41:46 +09:00
|
|
|
|
|
|
|
|
// 개발 환경에서 CORS 처리
|
|
|
|
|
async headers() {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
source: "/api/:path*",
|
|
|
|
|
headers: [
|
|
|
|
|
{ key: "Access-Control-Allow-Origin", value: "*" },
|
|
|
|
|
{ key: "Access-Control-Allow-Methods", value: "GET,POST,PUT,DELETE,OPTIONS" },
|
|
|
|
|
{ key: "Access-Control-Allow-Headers", value: "Content-Type, Authorization" },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
},
|
|
|
|
|
|
2025-09-04 16:55:11 +09:00
|
|
|
// 환경 변수 (런타임에 읽기)
|
2025-08-21 09:41:46 +09:00
|
|
|
env: {
|
2025-10-27 09:49:13 +09:00
|
|
|
// 항상 명시적으로 백엔드 포트(8080)를 지정
|
|
|
|
|
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL || "http://localhost:8080/api",
|
2025-08-21 09:41:46 +09:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default nextConfig;
|