init
This commit is contained in:
@@ -7,12 +7,13 @@ RUN apk add --no-cache curl
|
|||||||
|
|
||||||
# 환경변수 설정
|
# 환경변수 설정
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
ENV NODE_OPTIONS="--enable-source-maps"
|
||||||
|
|
||||||
# package.json만 먼저 복사
|
# package.json 복사
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
# 의존성 설치 (devDependencies 포함 - nest CLI 필요)
|
# 의존성 설치 (devDependencies 포함 - nest CLI 필요)
|
||||||
RUN npm install
|
RUN npm install --include=dev
|
||||||
|
|
||||||
# 소스 코드 복사
|
# 소스 코드 복사
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|||||||
@@ -3,9 +3,12 @@
|
|||||||
# ==============================================
|
# ==============================================
|
||||||
NODE_ENV=development
|
NODE_ENV=development
|
||||||
|
|
||||||
# API 설정 - 로컬 백엔드 직접 호출
|
# 클라이언트 API URL
|
||||||
NEXT_PUBLIC_API_URL=http://localhost:4000
|
NEXT_PUBLIC_API_URL=http://localhost:4000
|
||||||
|
|
||||||
|
# 서버사이드 프록시용 (next.config.ts rewrites)
|
||||||
|
BACKEND_INTERNAL_URL=http://localhost:4000
|
||||||
|
|
||||||
# 앱 설정
|
# 앱 설정
|
||||||
NEXT_PUBLIC_APP_NAME=한우 유전능력 시스템
|
NEXT_PUBLIC_APP_NAME=한우 유전능력 시스템
|
||||||
NEXT_TELEMETRY_DISABLED=1
|
NEXT_TELEMETRY_DISABLED=1
|
||||||
|
|||||||
@@ -3,8 +3,11 @@
|
|||||||
# ==============================================
|
# ==============================================
|
||||||
NODE_ENV=development
|
NODE_ENV=development
|
||||||
|
|
||||||
# API 설정 - Nginx 프록시 경유
|
# 클라이언트 API URL (브라우저에서 호출)
|
||||||
NEXT_PUBLIC_API_URL=http://genome2025.turbosoft.kr:4000
|
NEXT_PUBLIC_API_URL=/backend/api
|
||||||
|
|
||||||
|
# 서버사이드 프록시용 (next.config.ts rewrites)
|
||||||
|
BACKEND_INTERNAL_URL=http://host.docker.internal:4000
|
||||||
|
|
||||||
# 앱 설정
|
# 앱 설정
|
||||||
NEXT_PUBLIC_APP_NAME=한우 유전능력 시스템
|
NEXT_PUBLIC_APP_NAME=한우 유전능력 시스템
|
||||||
|
|||||||
@@ -3,8 +3,11 @@
|
|||||||
# ==============================================
|
# ==============================================
|
||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
|
|
||||||
# API 설정 - Nginx 프록시 경유
|
# 클라이언트 API URL (브라우저에서 호출)
|
||||||
NEXT_PUBLIC_API_URL=http://genome2025.turbosoft.kr:4000
|
NEXT_PUBLIC_API_URL=/backend/api
|
||||||
|
|
||||||
|
# 서버사이드 프록시용 (next.config.ts rewrites)
|
||||||
|
BACKEND_INTERNAL_URL=http://host.docker.internal:4000
|
||||||
|
|
||||||
# 앱 설정
|
# 앱 설정
|
||||||
NEXT_PUBLIC_APP_NAME=한우 유전능력 시스템
|
NEXT_PUBLIC_APP_NAME=한우 유전능력 시스템
|
||||||
|
|||||||
11
frontend/.gitignore
vendored
11
frontend/.gitignore
vendored
@@ -9,7 +9,6 @@
|
|||||||
!.yarn/plugins
|
!.yarn/plugins
|
||||||
!.yarn/releases
|
!.yarn/releases
|
||||||
!.yarn/versions
|
!.yarn/versions
|
||||||
package-lock.json
|
|
||||||
|
|
||||||
# ==============================================
|
# ==============================================
|
||||||
# Build Output
|
# Build Output
|
||||||
@@ -66,3 +65,13 @@ next-env.d.ts
|
|||||||
.temp
|
.temp
|
||||||
.tmp
|
.tmp
|
||||||
|
|
||||||
|
# ==============================================
|
||||||
|
# Environment Variables
|
||||||
|
# ==============================================
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
.env.prod
|
||||||
|
# .env.dev는 허용 (배포용)
|
||||||
|
!.env.dev
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
|||||||
@@ -11,13 +11,11 @@ COPY package*.json ./
|
|||||||
# 의존성 설치
|
# 의존성 설치
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# 소스 코드 복사
|
# 소스 코드 복사 (node_modules 제외 - .dockerignore)
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# 빌드 시 필요한 환경 변수 설정
|
# 빌드 시 필요한 환경 변수 설정
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
ENV NODE_ENV=production
|
|
||||||
ENV NEXT_PUBLIC_API_URL=/backend/api
|
|
||||||
|
|
||||||
# Next.js 빌드
|
# Next.js 빌드
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|||||||
@@ -1,19 +1,22 @@
|
|||||||
import type { NextConfig } from "next";
|
import type { NextConfig } from "next";
|
||||||
|
|
||||||
// Next.js 핵심 설정 파일, Next.js가 시작할 때 이 파일을 찾아서 읽음
|
// 백엔드 URL 설정
|
||||||
// 여기에 Next.js 설정 옵션을 정의할 수 있음
|
// 로컬: http://localhost:4000
|
||||||
|
// Docker: http://host.docker.internal:4000
|
||||||
|
const BACKEND_URL = process.env.BACKEND_INTERNAL_URL || 'http://localhost:4000';
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
eslint: {
|
eslint: {
|
||||||
ignoreDuringBuilds: true, // 빌드 시 ESLint warning 무시
|
ignoreDuringBuilds: true,
|
||||||
},
|
},
|
||||||
typescript: {
|
typescript: {
|
||||||
ignoreBuildErrors: true, // 빌드 시 TypeScript 에러 무시 (임시)
|
ignoreBuildErrors: true,
|
||||||
},
|
},
|
||||||
async rewrites() {
|
async rewrites() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
source: '/backend/api/:path*', // /api가 붙은 모든 요청
|
source: '/backend/api/:path*',
|
||||||
destination: 'http://192.168.11.249:4000/:path*', // 백엔드 API로 요청
|
destination: `${BACKEND_URL}/:path*`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
import type { NextConfig } from "next";
|
|
||||||
|
|
||||||
// Next.js 핵심 설정 파일, Next.js가 시작할 때 이 파일을 찾아서 읽음
|
|
||||||
// 여기에 Next.js 설정 옵션을 정의할 수 있음
|
|
||||||
const nextConfig: NextConfig = {
|
|
||||||
eslint: {
|
|
||||||
ignoreDuringBuilds: true, // 빌드 시 ESLint warning 무시
|
|
||||||
},
|
|
||||||
typescript: {
|
|
||||||
ignoreBuildErrors: true, // 빌드 시 TypeScript 에러 무시 (임시)
|
|
||||||
},
|
|
||||||
async rewrites() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
source: '/backend/api/:path*', // /api가 붙은 모든 요청
|
|
||||||
destination: 'http://192.168.11.249:4000/:path*', // 백엔드 API로 요청
|
|
||||||
},
|
|
||||||
];
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default nextConfig;
|
|
||||||
Reference in New Issue
Block a user