빌드 시 환경변수 적용

This commit is contained in:
hyeonsu 2025-09-04 16:55:11 +09:00
parent 71b509b11e
commit 2bffec1dbf
2 changed files with 6 additions and 2 deletions

View File

@ -22,6 +22,10 @@ COPY . .
# Disable telemetry during the build
ENV NEXT_TELEMETRY_DISABLED 1
# 빌드 시 환경변수 설정 (ARG로 받아서 ENV로 설정)
ARG NEXT_PUBLIC_API_URL=http://192.168.0.70:8080/api
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
# Build the application
ENV DISABLE_ESLINT_PLUGIN=true
RUN npm run build

View File

@ -41,9 +41,9 @@ const nextConfig = {
];
},
// 환경 변수 (런타임에 읽기) - 로컬 개발환경용
// 환경 변수 (런타임에 읽기)
env: {
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL || "http://localhost:8080/api",
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL || "http://192.168.0.70:8080/api",
},
};